1 | {
|
2 | "for...of": "for(var i of [1,2,3]) {}",
|
3 |
|
4 | "RegExp.prototype.sticky": "return typeof RegExp.prototype.sticky !== 'undefined'",
|
5 | "RegExp.prototype.unicode": "return typeof RegExp.prototype.unicode !== 'undefined'",
|
6 |
|
7 | "const": "const b=42",
|
8 | "let": "let a=42",
|
9 | "Destructuring": "var {a:A,b:B=3}={a:1};var [a,b]=[1,2];",
|
10 | "Spread Array": "var a=[...[1,2]];var [...b]=a;",
|
11 | "Spread Function call": "function t(a,b) {};t(...[1,2]);t.call(this,...[1,2])",
|
12 | "Rest parameters": "function t(a,...args) {};t(...[1,2,3]);t.call(this,...[1,2,3])",
|
13 | "Default parameters": "function t(a=1) {};t()",
|
14 | "Arrow function": "var f=()=>{}",
|
15 | "Generator function": "function* g(){}",
|
16 | "Binary literals": "0b00100001",
|
17 | "Octal literals": "0o222",
|
18 | "Template Strings": "function f(a, b) {return a[0]+(b+1)+a[1];}var s=`life=${40+2}`,t=f`a:${5}x`",
|
19 | "Shorthand property": "var a=2,o={a}",
|
20 | "Shorthand method": "var o={a(){}}",
|
21 | "Computed property": "var a='a',o={[a]:1,['p']:2,[a+'p']:3}",
|
22 | "Block level function declaration": "(function(){'use strict';function f(){return 1;}{function f(){return 2;}}if(f()===2)throw 'Failed';})()",
|
23 | "class": "class A {};class B extends A {}"
|
24 | }
|