Skip to content

Commit 5690f83

Browse files
authored
Merge pull request sadanandpai#37 from ptbhatcoder/patch-1
Fixing function output and also fn argument typo
2 parents b7c66d1 + 04fdd7b commit 5690f83

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

challenges/functions-concepts.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -381,16 +381,16 @@ Array and object are used in the programs to contain multiple values
381381
- Default function parameters allow named parameters to be initialized with default values if no value or undefined is passed
382382

383383
```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"){
385385
console.log(num, string, bool, sum);
386386
}
387387

388388
// 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
394394
```
395395

396396
###### Notes
@@ -673,7 +673,7 @@ const proxy = new Proxy(function () { console.log(arguments); }, {
673673

674674
// driver code
675675
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
677677
proxy.apply({}, [5, 10]); // Proxy apply is invoked on target with context: [object Object], arguments: 5,10
678678
```
679679

0 commit comments

Comments
 (0)