File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ cat > jaw-dropping-questions.md << 'EOF'
2+
3+ cat > jaw-dropping-questions.md << 'EOF'
4+ # Jaw-Dropping JavaScript Interview Questions
5+
6+ Here are some advanced and surprising JavaScript interview questions I recently encountered.
7+
8+ ## 1. Why does [ ] == ![ ] evaluate to true?
9+ Answer: Because [ ] becomes "", ![ ] becomes false → "" == false → true.
10+
11+ ## 2. What is event loop starvation?
12+ Answer: When microtasks continuously run and block macrotasks from executing.
13+
14+ ## 3. Difference between microtask queue and macrotask queue?
15+ Answer: Microtasks run immediately after current execution; macrotasks run in next event loop step.
16+
17+ ## 4. Why is typeof null === "object"?
18+ Answer: Legacy bug from the first JS implementation; null was represented as a null pointer.
19+
20+ ## 5. What happens when you delete an array index?
21+ Answer: It leaves a hole (empty slot), does NOT reindex the array.
22+
23+ ## 6. Explain Temporal Dead Zone with an example.
24+ Answer: A period between variable creation and initialization where using ` let ` /` const ` throws ReferenceError.
You can’t perform that action at this time.
0 commit comments