This repo contains simple and practical examples demonstrating many of the new features in ECMAScript 6. These are my notes, hopefully they will be useful to you!
The demos:
- Arrows:
simple
andpractical
- Classes
-
const
- Destructuring:
simple
andpractical
- For...of loops (related to Generators)
- Generators &
for
...of
loops -
let
- Map
- Objects
- Promise
- Proxy (not implemented in Babel!)
- Reflect
- Set
- Spread:
simple
- Template Strings:
simple
andpractical
- WeakMap
- WeakSet
The source files in src/
are meant to be read and messed around with. Running them will produce some useful console logs and should provide a simple way for you to play around with & learn the new features.
The ES6 files are in src/
. The gulp babel
task uses Babel to transpile the ES6 code down to javascript that can be run in Node. These files are created in the dist/
folder.
-
Download this repo:
git clone reponame
-
Install the dependencies:
npm install
-
Make sure you have
gulp
:npm install -g gulp
-
Run
gulp babel
-
Run any of the files in the
/dist/
folder to see the output:node dist/arrows/simple.js
Running gulp default
or just gulp
will watch the src/
folder for changes, transpiling them on save!
Now accepting pull requests.