Skip to content

Commit 0a3f2ef

Browse files
authored
Merge pull request #15 from AksharChaklashiya/issue/fixed-typo-and-output-error
Fixed few issue and updated code quality
2 parents 1451894 + 58f9e1b commit 0a3f2ef

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ Each proposal for an ECMAScript feature goes through the following maturity stag
306306
multiply: function(a, b) { return a * b; }
307307
};
308308

309-
console.log(calculation.add(5, 3)); // 8
309+
console.log(calculation.sum(5, 3)); // 8
310310
console.log(calculation.multiply(5, 3)); // 15
311311
```
312312

@@ -318,7 +318,7 @@ Each proposal for an ECMAScript feature goes through the following maturity stag
318318
multiply(a, b) { return a * b; }
319319
};
320320
321-
console.log(calculation.add(5, 3)); // 8
321+
console.log(calculation.sum(5, 3)); // 8
322322
console.log(calculation.multiply(5, 3)); // 15
323323
```
324324

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

845845
const user = new Proxy(target, handler);
846846
console.log(user.name); // John
847-
console.log(user.age); // John
847+
console.log(user.age); // 3
848848
console.log(user.gender); // gender does not exist
849849
```
850850

@@ -868,7 +868,7 @@ Each proposal for an ECMAScript feature goes through the following maturity stag
868868
}
869869
};
870870
871-
const person = new Proxy({}, validator);
871+
const person = new Proxy({}, ageValidator);
872872
873873
person.age = 30;
874874
console.log(person.age); // 30
@@ -1571,7 +1571,7 @@ Each proposal for an ECMAScript feature goes through the following maturity stag
15711571
```js
15721572
const obj = {'a': '1', 'b': '2', 'c': '3' };
15731573
const arr = Object.entries(obj);
1574-
console.log(obj); // [ ['a', '1'], ['b', '2'], ['c', '3'] ]
1574+
console.log(arr); // [ ['a', '1'], ['b', '2'], ['c', '3'] ]
15751575
```
15761576
15771577
But if you want to get the object back from an array then you need iterate and convert it as below,

es2015/15.map.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ console.log(typeMap.get('10') ); // string
1313
console.log(typeMap.get(keyObj)) // object
1414
console.log(typeMap.get({'one': 1})) // undefined
1515

16-
console.log(typeMap.size ); // 3
16+
console.log(typeMap.size ); // 4
1717

1818
for(let item of typeMap) {
1919
console.log(item);

es2015/19.proxies.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const handler = {
1313

1414
const user = new Proxy(target, handler);
1515
console.log(user.name); // John
16-
console.log(user.age); // John
16+
console.log(user.age); // 3
1717
console.log(user.gender); // gender does not exist
1818

1919
// validations
@@ -35,7 +35,7 @@ let ageValidator = {
3535
}
3636
};
3737

38-
const person = new Proxy({}, validator);
38+
const person = new Proxy({}, ageValidator);
3939

4040
person.age = 30;
4141
console.log(person.age); // 30

es2015/4.enhanced-object-literals.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var calculation = {
1313
multiply(a, b) { return a * b; }
1414
};
1515

16-
console.log( calculation.add(5, 3) ); // 15
16+
console.log( calculation.sum(5, 3) ); // 15
1717
console.log( calculation.multiply(5, 3) ); // 15
1818

1919
// Computed Property Names

0 commit comments

Comments
 (0)