Top Banner
The Future of JavaScript (ECMAScript-5) Alexander Tarasyuk
37

Ecma script 5

Jul 03, 2015

Download

Technology

Demo code https://github.com/AlexanderTarasyuk/ECMAScript5
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Ecma script 5

The Future of JavaScript (ECMAScript-5)

Alexander Tarasyuk

Page 2: Ecma script 5

Array• indexOf()• lastIndexOf()• every()• filter()• forEach()• map()• some()• isArray()• reduce()• reduceRight()

2

Page 3: Ecma script 5

3

indexOf

Page 4: Ecma script 5

4

lastIndexOf

Page 5: Ecma script 5

5

every

Page 6: Ecma script 5

6

filter

Page 7: Ecma script 5

7

forEach

Page 8: Ecma script 5

8

map

Page 9: Ecma script 5

9

some

Page 10: Ecma script 5

10

isArray

Page 11: Ecma script 5

11

reduce

Page 12: Ecma script 5

12

reduceRight

Page 13: Ecma script 5

String• trim()

13

Page 14: Ecma script 5

Date• now()• toISOString()

14

Page 15: Ecma script 5

15

toISOString

Page 16: Ecma script 5

Object• create()• defineProperty()• defineProperties()• keys()• getOwnPropertyDescriptor()• getOwnPropertyNames()• getPrototypeOf()• seal()• isSealed()• freeze()• isFrozen()• preventExtensions()• isExtensible()

16

Page 17: Ecma script 5

17

create

Page 18: Ecma script 5

18

Inheritance

Page 19: Ecma script 5

19

defineProperty

Page 20: Ecma script 5

20

writable, configurable, enumerable

Page 21: Ecma script 5

21

getters / setters

Page 22: Ecma script 5

22

keys

Page 23: Ecma script 5

23

getOwnPropertyNames

Page 24: Ecma script 5

24

getOwnPropertyDescriptor

Page 25: Ecma script 5

25

getPrototypeOf

Page 26: Ecma script 5

26

seal, isSealed

Page 27: Ecma script 5

27

freeze, isFrozen

Page 28: Ecma script 5

28

preventExtensions, isExtensible

Page 29: Ecma script 5

JSON• parse()• stringify()

29

Page 30: Ecma script 5

30

parse

Page 31: Ecma script 5

31

stringify

Page 32: Ecma script 5

Function• bind()

32

Page 33: Ecma script 5

33

bind

Page 34: Ecma script 5

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

Page 35: Ecma script 5

Compatibility table

35

Page 36: Ecma script 5

ECMASCript-6• let• function main(a = 1) {} • const• Proxy Objects• module• import• yield • ......

36

Page 37: Ecma script 5

Thank You