ecma script 5
DESCRIPTION
Demo code https://github.com/AlexanderTarasyuk/ECMAScript5TRANSCRIPT
Array• indexOf()• lastIndexOf()• every()• filter()• forEach()• map()• some()• isArray()• reduce()• reduceRight()
2
Object• create()• defineProperty()• defineProperties()• keys()• getOwnPropertyDescriptor()• getOwnPropertyNames()• getPrototypeOf()• seal()• isSealed()• freeze()• isFrozen()• preventExtensions()• isExtensible()
16
Strict Mode• eval('"\010"')- is a SyntaxError• eval('010')- is a SyntaxError• __i_dont_exist = 1; - is a ReferenceError• eval = 1; - is a SyntaxError• arguments = 1; - is a SyntaxError• eval++; - is a SyntaxError• arguments++; - is a SyntaxError• arguments.caller; - is a TypeError• (function(x){ x = 2; return arguments[0] === 1; })(1);• (function(x){ arguments[0] = 2; return x === 1; })(1);• ({ x: 1, x: 1 }); - is a SyntaxError• ({ set x(eval){ } }); - is a SyntaxError• ({ set x(arguments){ } }); - is a SyntaxError• eval('var x'); x; - is a ReferenceError• (function(){ return this === undefined; })();• (function(){ return this === undefined; }).call();• var x; delete x; - is a SyntaxError• delete (function(){}).length; - is a TypeError• (function f() { f = 123; })() - is a TypeError• Object.defineProperty({ }, "x", { writable: false }).x = 1• .......
34
ECMASCript-6• let• function main(a = 1) {} • const• Proxy Objects• module• import• yield • ......
36