- ECMAScript 6 is the gin and juice of 2015.
- installation: $ gem install sprockets-es6
- gem "sprockets"
- gem "sprockets-es6"
- require "sprockets/es6"
- converts ES6(2015) into ES5(2009) with Babel. Thereby, browsers behind the curve don't have to worry about how to handle ES6.
Looking at the ES6 Features link below, discuss one update from ES5 and if it seems useful/superfluous,
- let dollaz = $1,000,000
- let cents = sense
If it don't make ${dollaz}, it don't make ${cents}.
- const = single assignment(not dynamic)
- modules (seems verbose)
// lib/math.js export function sum(x, y) { return x + y; }
export var pi = 3.141593; // app.js import * as math from "lib/math"; alert("2π = " + math.sum(math.pi, math.pi));
- Tail Calls, what a name
- Unicode. I am not touching anything with chinese characters besides to-go boxes and fortune cookies