Skip to content

Commit 3452166

Browse files
authored
Merge pull request #351 from mohamedabdelhaq-123/fix/duplicate-coding-question
Remove duplicate coding question 86
2 parents 5de110a + 802b7f8 commit 3452166

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

README.md

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12501,36 +12501,8 @@ If a function is called with `undefined`, the `undefined` value is treated as a
1250112501
</p>
1250212502
</details>
1250312503
12504-
**[⬆ Back to Top](#table-of-contents)**
12505-
1250612504
#### 86. What is the output of below code?
1250712505
12508-
```javascript
12509-
function func(a, b = 2) {
12510-
console.log(arguments.length);
12511-
}
12512-
12513-
func(undefined);
12514-
func();
12515-
```
12516-
12517-
- 1: 1, 0
12518-
- 2: 0, 0
12519-
- 3: 0, 1
12520-
- 4: 1, 1
12521-
12522-
<details><summary><b>Answer</b></summary>
12523-
<p>
12524-
12525-
##### Answer: 1
12526-
12527-
If a function is called with `undefined`, the `undefined` value is treated as a parameter. But if the function is not passed with any parameters, the `arguments` object doesn't include any argument eventhough the function has default function parameter. Hence, the function invocation with `undefined` has one argument and function call without any arguments has 0 arguments.
12528-
12529-
</p>
12530-
</details>
12531-
12532-
#### 87. What is the output of below code?
12533-
1253412506
```javascript
1253512507
const numbers = [1, 2, 3];
1253612508

0 commit comments

Comments
 (0)