Skip to content

Instantly share code, notes, and snippets.

@ToniRib
Forked from rrgayhart/es6.markdown
Last active March 23, 2016 15:54
Show Gist options
  • Save ToniRib/bd53d087f8669dc896ab to your computer and use it in GitHub Desktop.
Save ToniRib/bd53d087f8669dc896ab to your computer and use it in GitHub Desktop.
es6 - 1510

Throughout the module (and your journey to Google enlightenment while working on IdeaBox2.0) you may notice a few different ways that JavaScript code is being written.

That might have something to do with something called ES6 and ES5

Fork this gist and answer the following questions:

  • What is ES6?
    • ES6 is "ECMAScript6" which is the next iteration of ECMAScript (aka what we commonly refer to as JavaScript). It has a bunch of cool features like string interpolation (finally!!!) and browsers are currently working on support for it. Apparently the official name is now also "ECMAScript2015." ES5 came out originally in 2009.
  • What is Transpilation and how does it relate to ES6?
    • Transpilation is the process of converting ES6 code to ES5 code. This can be done with a tool like Babel. This allows developers to write ES6 that can still run on browsers that might not support all of the functionality yet. Thus, you can take advantage of the updates from ES6 without having to worry about whether or not it will work in the browser.
  • Looking at the ES6 Features link below, discuss one update from ES5 and if it seems useful/superfluous.
    • Template strings are by far my favorite update. Being able to write "Hello ${name}, how are you ${time}?" instead of "Hello " + name + ", how are you " + time + "?" is incredibly useful. I spend a lot of time in JS making complicated strings and having to concatenate them all together. This seems like an update that probably should have been added earlier since so many other languages have this capability, but I'm just glad JS finally got around to it.
    • On another note, I'm also excited that Babel can be used with Rails so we can use ES6 in our applications today! It also looks like Chrome supports most of ES6 already.

Resources:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment