Skip to content

Instantly share code, notes, and snippets.

@stevepentler
Last active March 28, 2016 01:26
Show Gist options
  • Save stevepentler/7aa44247638fff21a243 to your computer and use it in GitHub Desktop.
Save stevepentler/7aa44247638fff21a243 to your computer and use it in GitHub Desktop.
What is ES6?
  • ECMAScript 6 is the gin and juice of 2015.
  • installation: $ gem install sprockets-es6
  • Gemfile

  • gem "sprockets"
  • gem "sprockets-es6"
  • require "sprockets/es6"
What is Transpilation and how does it relate to 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,

Useful

  • 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

Superfluous

  • Unicode. I am not touching anything with chinese characters besides to-go boxes and fortune cookies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment