Understanding ECMA Script 6 Javascript by Gaurav Khurana

115
ECMA Script Javascript 6 By Gaurav Khurana

Transcript of Understanding ECMA Script 6 Javascript by Gaurav Khurana

Page 1: Understanding ECMA Script 6 Javascript by Gaurav Khurana

ECMA Script Javascript 6By

Gaurav Khurana

Page 2: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

2

Table of content• History• Goals of ECMAScript 6.• What changes are incorporated in Javascript?• Variables and Scoping.

– Block-Scoped Variables.– Destructuring Objects.

• Extraction from Objects and Swap Variables– Objects Literals.– Multiple return Values.– Destructuring Arrays.– Destructuring Refutable by default.

Page 3: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

3

• Parameter Handling– Parameter default Values.– Rest parameters.– Spread Operators.– Named parameters.

• Arrow Functions– Less to type.– Lexical this no more that/self=this.

• Object Orientation and Modularity– Object Literals– Classes

Page 4: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

4

– Subclass– Modules :- named exports.– Modules :- default export.– Modules other features.

• Template String– String interpolation– Interpolation , raw string– Regular Expression– Other use cases

• Standard Library– Map– Sets

Page 5: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

5

– Object.assign– New String Methods– New Array Methods

• Loops and Iteration– Iterables and Iterators– For of loop

• Generators– Implementing an Iterator– Asynchronous programming

• Symbols– Enum -style value– Property keys

Page 6: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

6

• Various Other Features

Page 7: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

7

Prerequisite

• Knowledge of ECMAScript 3 javascript is must• ECMAScript 5 is a plus.• Object Oriented Javascript advance

understanding.• Understanding of nodejs would be plus (not

mandatory)

Page 8: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

8

Lets get started

Page 9: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

9

Background

Page 10: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

10

Background continue. . .

Page 11: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

11

Technical Committee

Page 12: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

12

Important ES6 Terms• TC39 (Ecma Technical Committee 39): the committee evolving

JavaScript.– Members: companies (all major browser vendors etc.).– Meetings attended by employees and invited experts.

• ECMAScript: the official name of the language– Versions: ECMAScript 5 is short for “ECMAScript Language

Specification, Edition 5”• JavaScript:

– colloquially: the language– formally: one implementation of ECMAScript

• ECMAScript Harmony: improvements after ECMAScript 5(ECMAScript 6 and 7)

Page 13: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

13

What changes are incorporated in Javascript

• Variable and Scoping.• Parameter Handling• Arrow Functions• Object Orientation and Modularity• Template String• Standard Library• Loops and Iteration• Symbols

Page 14: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

14

Variable and scoping

• Typical problem with ES5

Page 15: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

15

Block Scope

• Each Block has its own Lexical Enviorment.• Let/const bind variables to the lexical

Enviorment.• Variables declared with let/const are NOT

hoisted.

Page 16: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

16

var vs let

Page 17: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

17

const

Page 18: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

18

Question

• How will you create const in ECMA 5 ?

Page 19: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

19

Block Scope

• Solution to this problem in ES5

Page 20: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

20

Block Scope

• Solution to this problem in ES6

Page 21: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

21

Block Scope

Page 22: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

22

Block Function

Page 23: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

23

Object Destructuring

Page 24: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

24

Destructuring Array

Page 25: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

25

Extraction from Objects and Swap Variables

Page 26: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

26

Destructuring Multiple Return Values

Page 27: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

27

Destructuring refutable by default

Page 28: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

28

Destructuring nested Objects

Page 29: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

29

Destructuring nested Objects

Page 30: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

30

Default Parameters

Page 31: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

31

Arity

• Arity means number for parameters a function can take.

Page 32: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

32

Rest Parameters

Page 33: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

33

Rest Restriction

Page 34: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

34

Arity

• Arity means number for parameters a function can take

Page 35: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

35

Spread Operators

Page 36: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

36

Named Parameters

Page 37: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

37

Arrow Function

• Sugar Syntax• Lexical this• No Constructor

Page 38: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

38

Arrow Function elaborated

Page 39: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

39

Understanding lexical this

Page 40: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

40

Understanding lexical this . . .

Page 41: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

41

How Bind Would be working

Page 42: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

42

Understanding lexical this . . .

Page 43: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

43

Answer to Const in ECMA5

Page 44: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

44

Object Orientation and modularity

Page 45: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

45

Object Orientation and modularity . . .

Page 46: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

46

Class old School way

Page 47: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

47

Class ECMA5 way

Page 48: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

48

Class ECMA 6 way

Page 49: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

49

Module

• import

• export

Page 50: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

50

Module . . .

Page 51: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

51

Template String

Page 52: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

52

Template String use case

Page 53: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

53

Template String for Dynamic RegExp

Page 54: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

54

Map

• Key Value• Maps can have non-string keys (Object can be key)• Maps don't have prototype leakage issues, i.e. no

need to• use hasOwnProperty()• Different Types of Values• get(key)/ has(key) / set(key,val)• clear()• entries()

Page 55: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

55

Map vs ECMA5 way

Page 56: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

56

Map

Page 57: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

57

Setting Map Different Ways

Page 58: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

58

Object can be a Map

Page 59: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

59

Iterating over Map

Page 60: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

60

Filtering and Mapping

• You can map() and filter() arrays, but there are no such operations for maps. The solution1. Convert the map into an array of [key,value]

pairs.2. Map or filter the array.3. Convert the result back to a map.

Page 61: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

61

Filtering and Mapping . . .

Page 62: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

62

Set

• Set of Values (No Duplicates).• Different Types of Values.• add(key)/ has(key) / delete(key).• entries() -> Iterator

Page 63: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

63

Set . . .

Chrome

Page 64: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

64

Question

Why I am not able to see methods of set2 or countries object?

Chrome

Page 65: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

65

Answer

• We are not able to see methods of set2 or countries objects because they were made enumerable : false

Page 66: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

66

Answer . . .

Page 67: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

67

WeakMap

• Avoid memory leak• Reference to the key object held weakly• Key must be an object• No iterator methods• No clear

Page 68: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

68

WeakMap not working in Traceur

Page 69: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

69

WeakMap in Chrome harmony

Page 70: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

70

Object Methods

• Object.setPrototypeOf(obj, proto)• Object.assign(obj, mixin)• Object.is(value1, value2)

Page 71: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

71

Object property Assignment ES 5 vs ES6

Page 72: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

72

Object.setPrototypeOf

Fix this problem

Page 73: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

73

Object.setPrototypeOf fixing problem

Now there will be another problem .. Any guess?

Page 74: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

74

Object.is

Page 75: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

75

String Methods

• startsWith• endsWith• Includes• repeat

Page 76: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

76

Number Methods

• .isNAN() better than isNAN()• .isFinite()• .isInteger()

Page 77: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

77

Number Methods . . .

Page 78: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

78

Number Methods . . .

Page 79: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

79

Math methods

Page 80: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

80

Math Methods . . .

Page 81: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

81

Other Math methods

• log10, log2, log1p, expm1, cosh, sinh, tanh,• acosh, asinh, atanh, hypot, trunc, sign

Page 82: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

82

Array methods

• To be continued

Page 83: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

83

Proxy

• Before we can get into what proxies are and why they are useful, we first need to understand what meta programming is.

• In programming we have two levels– Base Level/application level (Code process user

input)– Meta level(code process base level code).

Page 84: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

84

Proxy . . .

• Let’s use JavaScript as both meta programming language and base programming language.

• Classic example is eval in javascript

Page 85: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

85

Proxy . . .• Lets look at another example in pure javascript

• The program is examining its own structure while running. This doesn’t look like meta programming, because the separation between programming constructs and data structures is vague in JavaScript. All of the Object.* methods can be considered meta programming functionality.

Page 86: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

86

Proxy . . .

• Different Types of Meta Programming– Introspection:- You have read only access to the

structure of a program. Example (Object.keys())– Self-Modification:- You can change that structure.

(Will show you example of this)– Intercession:- You can redefine the semantics of

some language operations.

Page 87: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

87

Proxy . . .• Self Modification Example

• It performs self-modification via the bracket operator for property access, the assignment operator and the delete operator

Page 88: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

88

Proxy . . .

• JavaScript doesn’t currently support intercession, proxies were created to fill that gap.

• Operations we perform on Javascript objects can be say – Getting a property prop (obj.prop)– Listing enumerable own properties (via

Object.keys(obj)).

Page 89: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

89

Proxy . . .

• Proxies are special objects that allow you to provide custom implementations for some of these operations.

• A Proxy is created with two parameters– Handler

• For each operation, there is a corresponding handler method that – if present performs that operation.

• Such a method intercepts the operation (on its way to the target) and is called a trap

– Target• If the handler doesn’t intercept an operation then it is performed

on the target i.e. it acts as a fallback for handler.

Page 90: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

90

Proxy . . .

• Firefox support proxy there by following is the example of proxy

Page 91: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

91

Proxy . . .

• As I said if handler doesn’t intercept the operation the operation is performed on target.

Page 92: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

92

Proxy . . .

• As a matter of fact we made get request for name in pervious example and for the same we doesn’t have trap(or handler) assigned.

• Lets assign the same.

Result

Page 93: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

93

Proxy . . .

• Few more traps

Page 94: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

94

For of loop

Page 95: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

95

Generators

• Simple Example

Page 96: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

96

Generators

• Passing Value Back to Generator

Page 97: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

97

Generators

function* helloWorld(){ var next = yield "hello"; yield next;}

var hw = helloWorld();console.log(hw.next());console.log(hw.next('world'));console.log(hw.next());

Page 98: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

98

Generators

function* helloWorld(){ var next = yield "hello"; yield next;}

var hw = helloWorld();console.log(hw.next());console.log(hw.next('world'));console.log(hw.next());

Page 99: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

99

Generators

function* helloWorld(){ var next = yield "hello"; yield next;}

var hw = helloWorld();console.log(hw.next());console.log(hw.next('world'));console.log(hw.next());

Page 100: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

100

Generators

function* helloWorld(){ var next = yield "hello"; yield next;}

var hw = helloWorld();console.log(hw.next());console.log(hw.next('world'));console.log(hw.next());

Page 101: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

101

Generators

function* helloWorld(){ var next = yield "hello"; yield next;}

var hw = helloWorld();console.log(hw.next());console.log(hw.next('world'));console.log(hw.next());

Page 102: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

102

Generators

function* helloWorld(){ var next = yield ; yield next;}

var hw = helloWorld();console.log(hw.next());console.log(hw.next('world'));console.log(hw.next());

Page 103: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

103

Generators

function* helloWorld(){ var next = yield yield next;}

var hw = helloWorld();console.log(hw.next());console.log(hw.next('world'));console.log(hw.next());

Page 104: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

104

Generators

function* helloWorld(){ var next = yield yield next;}

var hw = helloWorld();console.log(hw.next());console.log(hw.next('world'));console.log(hw.next());

Page 105: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

105

Generators

Page 106: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

106

Promise

• Before we jump into promise let me create a scenario to explain the actual need of promise.

Page 107: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

107

Promise

• As we are familiar with the fact that java script is single threaded.

• In browsers, JavaScript shares a thread with a load of other stuff.

• What that stuff is differs from browser to browser, but typically JavaScript is in the same queue as painting, updating styles, and handling user actions

Page 108: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

108

Promise

• As a human being, you're multithreaded. You can type with multiple fingers, you can drive and hold a conversation at the same time.

• The only blocking function we have to deal with is sneezing, where all current activity must be suspended for the duration of the sneeze.

• That's pretty annoying, especially when you're driving and trying to hold a conversation. You don't want to write code that's sneezy

Page 109: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

109

Promise• You've probably used events and callbacks to get around this. Here

are events:• Lets assume we need a intimation from browser when our image is

loaded.

• Lets Run this on browser

Page 110: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

110

Promise

Page 111: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

111

Promise

• What if the events happened before we started listening for them

Page 112: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

112

Promise

Page 113: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

113

Promise

• Lets implement a Promise on Ajax call.• I have created small http server using nodejs

which is listening to port 8888 and will return text of file test.txt if requested url is /getData

Page 114: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

114

Promise

• Additionally I have created on promisify-xml-httpRequest.html

Page 115: Understanding ECMA Script 6 Javascript by Gaurav Khurana

Prepared By Gaurav Khurana ([email protected])

115