File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,4 +14,4 @@ let max = (a, b) => {
1414
1515console . log ( 'inc(5) = ' + inc ( 5 ) ) ;
1616console . log ( 'sum(1, 3) = ' + sum ( 1 , 3 ) ) ;
17- console . log ( 'max(8, 6) = ' + max ( 5 , 6 ) ) ;
17+ console . log ( 'max(8, 6) = ' + max ( 8 , 6 ) ) ;
Original file line number Diff line number Diff line change 11'use strict' ;
22
3- let sum = new Function ( 'a,b' , 'return a+ b' ) ;
3+ let sum = new Function ( 'a, b' , 'return a + b' ) ;
44
55console . dir ( {
66 name : sum . name ,
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ let obj1 = {
4+ f1 : function inc ( a ) {
5+ return ++ a ;
6+ } ,
7+ sum : function ( a , b ) {
8+ return a + b ;
9+ } ,
10+ max : ( a , b ) => {
11+ return a > b ? a : b ;
12+ }
13+ } ;
14+
15+ console . log ( 'obj1.f1.name = ' + obj1 . f1 . name ) ;
16+ console . log ( 'obj1.sum.name = ' + obj1 . sum . name ) ;
17+ console . log ( 'obj1.max.name = ' + obj1 . max . name ) ;
18+
19+ console . log ( 'obj1.f1(5) = ' + obj1 . f1 ( 5 ) ) ;
20+ console . log ( 'obj1.sum(1, 3) = ' + obj1 . sum ( 1 , 3 ) ) ;
21+ console . log ( 'obj1.max(8, 6) = ' + obj1 . max ( 8 , 6 ) ) ;
You can’t perform that action at this time.
0 commit comments