var compute = a => a * 3;
http://www.es6fiddle.net/i76oa5cn/
class Shape { render() { console.log("Shape"); } } class Triangle extends Shape { render() { super.render(); console.log("Triangle"); } }
http://www.es6fiddle.net/i76oqpud/
var shape = { render() { console.log("Shape"); } };
http://www.es6fiddle.net/i76p0nl1/
var shape = { width: 5, height: 8, }; var { width, height } = shape;
http://www.es6fiddle.net/i76pau65/
function log(message, ...data) { console.log(message); console.log(data); } log("ERROR", 3, "crash");
http://www.es6fiddle.net/i76pjgyw/
let x = "Bob"; let x = "Alice"; // << // ERROR: Duplicate declaration
http://www.es6fiddle.net/i76pp4m5/
const x = "Bob"; x = "Alice"; // << // ERROR: x is read-only
http://www.es6fiddle.net/i76prhs0/
var s = new Set(); s.add("Bob"); console.log(s.has("Bob"));
http://www.es6fiddle.net/i76q87lb/
var what = "World"; var result = `Hello ${ what }`;
http://www.es6fiddle.net/i76p76jo/
(Template Strings)
By nercury