Enter Your Email Address to Watch This Lesson

Your link to unlock this lesson will be sent to this email address.

Unlock this lesson and all 833 of the free egghead.io lessons, plus get JavaScript content delivered directly to your inbox!

Existing egghead members will not see this. Sign in.

Just one more step!

Check your inbox for an email from us and click link to unlock your lesson.

Intro to ES6 and traceur compiler

2:42 JavaScript lesson by

es6 is the next generation of javascript. You can use it today with the traceur compiler library. Also be sure to check out es6fiddle to start playing with ECMAscript 6 right now.

egghead.io comment guidelines


es6 is the next generation of javascript. You can use it today with the traceur.js library. Also be sure to check out es6fiddle to start playing with ECMAscript 6 right now.


Go go gadgets Angular2.0, ES6 and Traceur! lol

Btw, I'll be wearing my egghead.io tshirt to work tommorrow!

In reply to egghead.io
Roman Ganchenko

I also got my t-shirt and going to wear on any angular events. Yah!

In reply to Wayne

Thank you for this one :)
keep it comming!

In reply to egghead.io

I'm going to hold you to that comment Wayne :D

In reply to Wayne

Now I need an egghead.io t-shirt lol

In reply to Will

Where did you get the t-shirt? :) I'd like to have one too :)

In reply to Wayne

John Lindquist: [0:00] ES6 is ECMAScript version 6, which JavaScript is based on. The next version of JavaScript is going to be based on version 6 of ECMAScript.

[0:11] Tracer is a way to compile that next version of JavaScript back into JavaScript of today, meaning that you can write the next version of JavaScript and have it compiled down to JavaScript you can use today, because ES6 isn't supported completely and not standardized completely across all the browsers, in Note and everything.

[0:33] While ES6 is still being standardized and all the browsers are still working on supporting all the different features, it's worth getting a head start because Angular 2.0 will be based on ECMAScript 6 in the future when it's released. Thanks to Tracer, we can start playing around with ES6 features today as well as some of the things that Angular has started releasing, like DI, that already use ES6.

[0:58] In the future, we'll also get to the ECMAScript 6+ that AngularJS 2.0 will work with, which adds things like annotations and some sort of typing. It's kind of what like TypeScript does by compiling the static-type JavaScript down to JavaScript.

[1:14] After you install Tracer using npm install Tracer using the -g global flag or not. Here I did and I just used Tracer to output this file, which is an ES6 file, to this Tracer-compiled file. Again, this is the JavaScript of today, the one that's being output, and this is ES6.

[1:37] Now, the file that this outputs is the file you'll want to use with the Tracer runtime, so you'll include the Tracer runtime first and then include the output file. Then the browser will be able to use this file just fine. Again, you're not using the ES6 file. You're using the output Tracer-compiled file. Then loading the Tracer runtime and then loading your own compiled file.

[2:02] If instead of using the browser, you want to invoke that file with node, simply use Tracer, and instead of using it to compile you can use it to run the output file and then run through the Tracer-compiled file using Tracer as the "runtime."

[2:18] While installing Tracer is as easy as npm install Tracer, if you want to jump right in, you can just open ES6 Fiddle in your browser and load one of the examples. Then hit run and you can begin playing with ES6 right away.

[2:34] Basically behind the scenes, this is compiling this to a Tracer-compiled file and then running it through Tracer to give you what the output of the console is.

Joel's Head
Why are we asking?