Default Parameters in ES6.
Template Literals in ES6.
Multi-line Strings in ES6.
Destructuring Assignment in ES6.
Enhanced Object Literals in ES6.
Arrow Functions in ES6.
Promises in ES6.
Block-Scoped Constructs Let and Const.
Notable improvements in es6 would be:
let and const Keywords
Arrow Functions
Multi-line Strings
Default Parameters
Template Literals
Destructuring Assignment
Enhanced Object Literals
Promises
Classes
Modules
// app.js
import * as math from "lib/math";
alert("2π = " + math.sum(math.pi, math.pi));
// lib/math.js
export function sum(x, y) {
return x + y;
}
export var pi = 3.141593;
// otherApp.js
import {sum, pi} from "lib/math";
alert("2π = " + sum(pi, pi));
// lib/mathplusplus.js
export * from "lib/math";
export var e = 2.71828182846;
export default function(x) {
return Math.log(x);
}
// app.js
import ln, {pi, e} from "lib/mathplusplus";
alert("2π = " + ln(e)*pi*2);
var asyncCall = new Promise((resolve, reject) => {
// do something
resolve();
}).then(()=> {
console.log('DON!');
})