@@ -381,16 +381,16 @@ Array and object are used in the programs to contain multiple values
381
381
- Default function parameters allow named parameters to be initialized with default values if no value or undefined is passed
382
382
383
383
``` js
384
- function defaultValueFunc (num = 10 , num2 = 20 , string = " Hello " , bool = false , sum = num1 + num2 ){
384
+ function defaultValueFunc (num = 10 , num2 = 20 , bool = false , sum = num + num2 , string = " Hello " ){
385
385
console .log (num, string, bool, sum);
386
386
}
387
387
388
388
// driver code
389
- defaultValueFunc (); // 10, 20 , false, 30
390
- defaultValueFunc (4 , 8 ); // 4, 8 , false, 12
391
- defaultValueFunc (10 , 4 , true ); // 10, 4 , true, 14
392
- defaultValueFunc (5 , 6 , false , 11 ); // 5, 6 , false, 11
393
- defaultValueFunc (undefined , undefined , false ); // 10, 20 , false, 30
389
+ defaultValueFunc (); // 10, 'Hello' , false, 30
390
+ defaultValueFunc (4 , 8 ); // 4, 'Hello' , false, 12
391
+ defaultValueFunc (10 , 4 , true ); // 10, 'Hello' , true, 14
392
+ defaultValueFunc (5 , 6 , false , 11 ); // 5, 'Hello' , false, 11
393
+ defaultValueFunc (undefined , undefined , false ); // 10, 'Hello' , false, 30
394
394
```
395
395
396
396
###### Notes
@@ -673,7 +673,7 @@ const proxy = new Proxy(function () { console.log(arguments); }, {
673
673
674
674
// driver code
675
675
proxy (1 , 2 , 3 ); // Proxy apply is invoked on target with context: undefined, arguments: 1,2,3
676
- proxy .call ({}, 1 , 2 ); // Proxy apply is invoked on target with context: undefined , arguments: 1,2,3
676
+ proxy .call ({}, 1 , 2 ); // Proxy apply is invoked on target with context: [object Object] , arguments: 1,2,3
677
677
proxy .apply ({}, [5 , 10 ]); // Proxy apply is invoked on target with context: [object Object], arguments: 5,10
678
678
```
679
679
0 commit comments