@@ -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,
0 commit comments