Skip to content

Instantly share code, notes, and snippets.

@PenneyGadget
Forked from rrgayhart/es6.markdown
Last active March 27, 2016 23:42
Show Gist options
  • Save PenneyGadget/4b3bf8c4fa9314ea77cd to your computer and use it in GitHub Desktop.
Save PenneyGadget/4b3bf8c4fa9314ea77cd 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 stands for 'ECMAScript 6' and is the 6th and most recent update to the ECMAScript language. ECMAScript is the "proper" name for our good 'ol friend Javascript! This version adds many new features including... string interpolation! YAY! ES6 is not yet supported in all browsers. Chrome and Firefox are leading the way.

  • What is Transpilation and how does it relate to ES6?

Because ES6 is not yet supported in all browsers (and yet many people will want to start using it or already are using it) z conversion needs to take place. This is transpilation - basically the process of converting new ES6 to ES5 so your code is browser compatible no matter where it's being run. There are available tools and libraries to assist with this.

  • Looking at the ES6 Features link below, discuss one update from ES5 and if it seems useful/superfluous.
  1. Classes - as a Rubyist this is cool because it allows JS to look a bit more like Ruby. Classes are a bit easier to read than the whole prototype thing, but I would put this change more in the convenience/superfluous category than anything else (it seems anyway).
  2. String interpolation === FUCK YEAH! This is useful for sure. All the quotes and plus signs in concatenation are a pain and make for headaches/easy mistakes.
  3. Whoa, if I am understanding arrows correctly they seem to also allow for writing blocks in a much more Ruby-esque manner. Very intriguing!

Resources:

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