Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

ES2015 - can you really use it in web development?

Hi, I've been learning about ES2015 recently and some of its new features but I was just wondering - would you actually want to use it in web development? It seems browser support is so low that you'd want to avoid it.

And what is the thinking behind pushing out a new version every year, as is the plan, if browsers are so slow to catch up that you can never really use the latest version?

Is it just for use on back-end scripts? Does it work okay on those?

2 Answers

Hi Harriet

You can write ES2015 and use babel (https://babeljs.io/) to compile it to ES5. That way you can use all the latest features of ES2015 and not have to worry about browser support.

Elliot

I've been using Babel and ES2015 in just about every JavaScript project, course, tutorial or whatever I've been working on, even when it doesn't call for it.

I think precompiling with tools like Babel is just the reality of working with something as fast-changing as JavaScript.

The method used by Babel is transpiling, you can read more about the difference at the below link.

https://www.stevefenton.co.uk/2012/11/compiling-vs-transpiling/

Great - thanks so much!