Skip to content

Commit 50f285b

Browse files
authored
Add new hoisting question
1 parent d39c6fe commit 50f285b

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

code-snippets/hoisting.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,4 +217,39 @@ foo();
217217
</details>
218218

219219
</li>
220+
221+
---
222+
223+
<li>
224+
225+
**What are the logged values of a and b ?**
226+
227+
```JS
228+
b = function a(){};
229+
var a = b = 6;
230+
a = function b(){};
231+
function b() {};
232+
function a() {};
233+
console.log(a,b);
234+
```
235+
236+
- A: `ƒ b(){} 6`
237+
- B: `ƒ a(){} 6`
238+
- C: `ƒ b(){} ƒ a(){}`
239+
- D: `ƒ a(){} ƒ b(){}`
240+
- E: `6 ƒ a(){}`
241+
- F: `6 ƒ b(){}`
242+
243+
<br/>
244+
245+
<details>
246+
<summary><b>Answer</b></summary>
247+
<p>
248+
249+
#### Option: A
250+
251+
</p>
252+
</details>
253+
254+
</li>
220255
</ol>

0 commit comments

Comments
 (0)