ECMA 6
- Véase ECMA6 new features
- Arrow functions
- An arrow function expression has a shorter syntax compared to function expressions and lexically binds the this value. Arrow functions are always anonymous.
- Template literals
- Template literals are string literals allowing embedded expressions.
- You can use multi-line strings and string interpolation features with template strings:
You can use multi-line strings and string interpolation features with them.let name = "Bob", time = "today"; `Hello ${name}, how are you ${time}?`
let
vsvar
- When used inside a block,
let
limits the variable's scope to that block. Note the difference betweenvar
whose scope is inside the function where it is declared.
- When used inside a block,
const
is single-assignment. Static restrictions prevent use before assignment.
Talk at jQuery 2014 by John K. Paul Conference: ES6 Right now
- Slides (running at Github.io)
- Source of the slides (written in Reveal.js) at GitHub
- John K. Paul at GitHub