Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ Each proposal for an ECMAScript feature goes through the following maturity stag
multiply: function(a, b) { return a * b; }
};

console.log(calculation.add(5, 3)); // 8
console.log(calculation.sum(5, 3)); // 8
console.log(calculation.multiply(5, 3)); // 15
```

Expand All @@ -318,7 +318,7 @@ Each proposal for an ECMAScript feature goes through the following maturity stag
multiply(a, b) { return a * b; }
};

console.log(calculation.add(5, 3)); // 8
console.log(calculation.sum(5, 3)); // 8
console.log(calculation.multiply(5, 3)); // 15
```

Expand Down Expand Up @@ -844,7 +844,7 @@ Each proposal for an ECMAScript feature goes through the following maturity stag

const user = new Proxy(target, handler);
console.log(user.name); // John
console.log(user.age); // John
console.log(user.age); // 3
console.log(user.gender); // gender does not exist
```

Expand All @@ -868,7 +868,7 @@ Each proposal for an ECMAScript feature goes through the following maturity stag
}
};

const person = new Proxy({}, validator);
const person = new Proxy({}, ageValidator);

person.age = 30;
console.log(person.age); // 30
Expand Down Expand Up @@ -1571,7 +1571,7 @@ Each proposal for an ECMAScript feature goes through the following maturity stag
```js
const obj = {'a': '1', 'b': '2', 'c': '3' };
const arr = Object.entries(obj);
console.log(obj); // [ ['a', '1'], ['b', '2'], ['c', '3'] ]
console.log(arr); // [ ['a', '1'], ['b', '2'], ['c', '3'] ]
```

But if you want to get the object back from an array then you need iterate and convert it as below,
Expand Down
2 changes: 1 addition & 1 deletion es2015/15.map.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ console.log(typeMap.get('10') ); // string
console.log(typeMap.get(keyObj)) // object
console.log(typeMap.get({'one': 1})) // undefined

console.log(typeMap.size ); // 3
console.log(typeMap.size ); // 4

for(let item of typeMap) {
console.log(item);
Expand Down
4 changes: 2 additions & 2 deletions es2015/19.proxies.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const handler = {

const user = new Proxy(target, handler);
console.log(user.name); // John
console.log(user.age); // John
console.log(user.age); // 3
console.log(user.gender); // gender does not exist

// validations
Expand All @@ -35,7 +35,7 @@ let ageValidator = {
}
};

const person = new Proxy({}, validator);
const person = new Proxy({}, ageValidator);

person.age = 30;
console.log(person.age); // 30
Expand Down
2 changes: 1 addition & 1 deletion es2015/4.enhanced-object-literals.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var calculation = {
multiply(a, b) { return a * b; }
};

console.log( calculation.add(5, 3) ); // 15
console.log( calculation.sum(5, 3) ); // 15
console.log( calculation.multiply(5, 3) ); // 15

// Computed Property Names
Expand Down