@@ -306,7 +306,7 @@ Each proposal for an ECMAScript feature goes through the following maturity stag
306
306
multiply : function (a , b ) { return a * b; }
307
307
};
308
308
309
- console .log (calculation .add (5 , 3 )); // 8
309
+ console .log (calculation .sum (5 , 3 )); // 8
310
310
console .log (calculation .multiply (5 , 3 )); // 15
311
311
```
312
312
@@ -318,7 +318,7 @@ Each proposal for an ECMAScript feature goes through the following maturity stag
318
318
multiply(a, b) { return a * b; }
319
319
};
320
320
321
- console.log(calculation.add (5, 3)); // 8
321
+ console.log(calculation.sum (5, 3)); // 8
322
322
console.log(calculation.multiply(5, 3)); // 15
323
323
` ` `
324
324
@@ -844,7 +844,7 @@ Each proposal for an ECMAScript feature goes through the following maturity stag
844
844
845
845
const user = new Proxy (target, handler);
846
846
console .log (user .name ); // John
847
- console .log (user .age ); // John
847
+ console .log (user .age ); // 3
848
848
console .log (user .gender ); // gender does not exist
849
849
```
850
850
@@ -868,7 +868,7 @@ Each proposal for an ECMAScript feature goes through the following maturity stag
868
868
}
869
869
};
870
870
871
- const person = new Proxy({}, validator );
871
+ const person = new Proxy({}, ageValidator );
872
872
873
873
person.age = 30;
874
874
console.log(person.age); // 30
@@ -1571,7 +1571,7 @@ Each proposal for an ECMAScript feature goes through the following maturity stag
1571
1571
` ` ` js
1572
1572
const obj = {' a' : ' 1' , ' b' : ' 2' , ' c' : ' 3' };
1573
1573
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'] ]
1575
1575
` ` `
1576
1576
1577
1577
But if you want to get the object back from an array then you need iterate and convert it as below,
0 commit comments