← All ebooks
JavaScriptJavaScript Output QuestionsCareerKit
- TopicJavaScript
- LevelIntermediate
- Length68 pages
- Inside100 questions
- FormatPDF
JavaScript Output Questions
Tricky "what does this print" questions with step-by-step explanations of why.
What's inside
- Hoisting and the temporal dead zone
- Closures inside loops
- this in different contexts
- Type coercion surprises
- Promises and setTimeout ordering
Sample from the ebook
What does console.log([] + []) print?
An empty string. Both arrays are converted to strings, and an empty array becomes "", so the result is "" + "".
₹199Was ₹39950% off
Free sample questions
Read 10 full answers from this ebook for free, and see all 100 questions it covers.
- var used before its declaration
- let used before its declaration
- setTimeout in a var loop
- setTimeout in a let loop