Skip to content

Instantly share code, notes, and snippets.

@marlomajor
Forked from rrgayhart/es6.markdown
Last active February 9, 2016 17:33
Show Gist options
  • Save marlomajor/dec9f6a3cfd56bcb3c8c to your computer and use it in GitHub Desktop.
Save marlomajor/dec9f6a3cfd56bcb3c8c to your computer and use it in GitHub Desktop.
ES6 Homework

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? -ECMAScript 6, is also known as ECMAScript 2015 and is the new standard for ES. It is the first major update since 2009 with ES5. Several major changes have been made to the language, including, but not limited to the following: -Arrows - functional shorthand using =>. Share the same this as the surrounding code. -Class - single declarative form allowing for more interoperability -Enhanced Object Literals - I do not know what this means. -Template Strings - good use of this will be in getting rid of + signs in JS rendering methods. -Destructuring -Default-Rest-Spread -Let + Const -Iterators + For..Of

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

  • I do not know what it is. But from reading it, it seems like a source to source compiler. Babel is a well known version for ES6/2015 ;)

  • Looking at the ES6 Features link below, discuss one update from ES5 and if it seems useful/superfluous.

  • The most useful thing I have seen are the use of template strings. Makes it a lot nicer to write JS code when I don't have to get confused doing something like this

    '<p' + " id=" + idea.id + " " + '>' +
    '<span class=title>' + idea.title + '</span>' + " " +```

### Resources:
- [ES6 Features](https://github.com/lukehoban/es6features)
- [Understanding ES6](https://github.com/sgaurav/understanding-es6)
- [Using ES6 with Rails](https://babeljs.io/docs/setup/#rails)
- [Using ES6 with Rails Slides](https://speakerdeck.com/stevekinney/using-javascript-from-the-future-in-your-rails-application-today?slide=145)
- [ES6 Compatibility](http://kangax.github.io/compat-table/es6/)
@rrgayhart
Copy link

👍

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