JSPrep Pro › JavaScript Output Questions ⚡ Predict the Output
JavaScript Output QuestionsWhat Does This Code Print? 67+ real JavaScript output prediction questions from frontend interviews. Read code → predict console.log → learn why.
✅ 67 questions · ✅ First 5 interactive free · ✅ Progress saved in quiz
⚡ How to use this page Try the first 5 questions here — click a question, type your prediction, check it. No account needed. The rest are in the interactive quiz where progress is tracked. Reading answers ≠ predicting them.
📋 Topics ⚙️ Event Loop & Promises 22 questions
#01 Synchronous code runs before setTimeout
Easy Event Loop & Promises event-loop settimeout
▾ #02 Promise microtask before setTimeout macrotask
Medium Event Loop & Promises event-loop promise
▾ #03 Promise chain passes values
Medium Event Loop & Promises promise chain
▾ #04 Two Promise chains interleave in microtask queue
Hard Event Loop & Promises promise microtask
▾ #05 await suspends function — caller continues
Medium Event Loop & Promises async await
▾ #06 setTimeout fires in delay order
Medium Event Loop & Promises settimeout order
▾ #07 Promise executor runs synchronously
Medium Event Loop & Promises promise executor
▾ #08 Nested setTimeout creates new macrotask
Hard Event Loop & Promises settimeout nested
▾ #09 Promise.then is always async — even when resolved
Medium Event Loop & Promises promise microtask
▾ #10 async function always returns a Promise
Medium Event Loop & Promises async promise
▾ #11 Multiple awaits — each is a microtask suspension
Hard Event Loop & Promises async await
▾ #12 Promise.reject caught by .catch — chain continues
Medium Event Loop & Promises promise catch
▾ #13 Promise.all preserves order
Medium Event Loop & Promises promise promise-all
▾ #14 queueMicrotask runs before setTimeout
Medium Event Loop & Promises queueMicrotask microtask
▾ #15 throw inside .then becomes rejection, caught by .catch
Hard Event Loop & Promises promise throw
▾ #16 async try/catch catches awaited rejection
Hard Event Loop & Promises async try-catch
▾ #17 Deep Copy vs Shallow Copy in Promise Resolution
Medium Event Loop & Promises
▾ #18 Understanding Call Stack Flow with Nested Function Calls
Easy Event Loop & Promises
▾ #19 Deep Copy vs Shallow Copy with Promises
Medium Event Loop & Promises
▾ #20 Deep Copy and Shallow Copy in Asynchronous Operations
Medium Event Loop & Promises
▾ #21 Chaining Promises with Optional Chaining and Nullish Coalescing
Hard Event Loop & Promises
▾ #22 Resolving Nested Promises with Optional Chaining and Nullish Coalescing
Hard Event Loop & Promises
▾ 🔒 Closures & Scope 13 questions
#23 Classic var in loop with setTimeout
Easy Closures & Scope closure var
▾ #24 let in loop — each iteration gets own binding
Easy Closures & Scope closure let
▾ #25 IIFE captures loop variable
Medium Closures & Scope closure iife
▾ #26 Closure mutation persists across calls
Medium Closures & Scope closure mutation
▾ #27 let block scope — inner does not leak
Easy Closures & Scope let block-scope
▾ #28 var leaks out of block, let does not
Easy Closures & Scope var let
▾ #29 Independent counter factory instances
Medium Closures & Scope closure factory
▾ #30 Closure captures binding not snapshot
Medium Closures & Scope closure reference
▾ #31 var inside function shadows outer
Medium Closures & Scope var hoisting
▾ #32 Medium Closures & Scope closure currying
▾ #33 Shared closure state across methods
Hard Closures & Scope closure object
▾ #34 for...in includes inherited properties, for...of does not
Hard Closures & Scope for-in for-of
▾ #35 Function is called with arguments object
Hard Closures & Scope arguments rest
▾ 👉 'this' Binding 10 questions
#36 Method call — this is the calling object
Easy 'this' Binding this method
▾ #37 Arrow function has no own this — inherits lexically
Easy 'this' Binding this arrow
▾ #38 bind permanently fixes this — call cannot override it
Medium 'this' Binding this bind
▾ #39 call vs apply — same result, different syntax
Medium 'this' Binding this call
▾ #40 Arrow callback inside method preserves this
Medium 'this' Binding this arrow
▾ #41 Method chaining — return this
Medium 'this' Binding this chaining
▾ #42 this in nested object — direct parent wins
Medium 'this' Binding this nested
▾ #43 bind with partial application
Hard 'this' Binding this bind
▾ #44 Class method loses this when destructured
Hard 'this' Binding this class
▾ #45 new vs plain call — different returns
Hard 'this' Binding this new
▾ #46 var declaration hoisted as undefined
Easy Hoisting hoisting var
▾ #47 Function declaration fully hoisted
Easy Hoisting hoisting function-declaration
▾ #48 Function expression not hoisted
Easy Hoisting hoisting function-expression
▾ #49 Local var shadows outer — from start of function
Medium Hoisting hoisting var
▾ #50 Function declaration takes priority over var in hoisting
Medium Hoisting hoisting function-declaration
▾ #51 which function declaration wins?
Medium Hoisting hoisting function-declaration
▾ #52 var escapes block, let does not
Hard Hoisting hoisting var
▾ 🔀 Type Coercion 15 questions
#53 Plus operator: string concat vs numeric add
Easy Type Coercion coercion plus
▾ #54 Loose equality edge cases with null
Medium Type Coercion coercion equality
▾ #55 Easy Type Coercion typeof primitives
▾ #56 Truthy and falsy — empty array and object are truthy
Medium Type Coercion boolean truthy
▾ #57 Unary plus converts to number
Medium Type Coercion coercion unary-plus
▾ #58 null comparison inconsistency
Hard Type Coercion coercion comparison
▾ #59 Short circuit: || vs ?? difference
Easy Type Coercion short-circuit or
▾ #60 Object valueOf for arithmetic, toString for template
Hard Type Coercion coercion valueOf
▾ #61 parseInt stops at first invalid character
Medium Type Coercion parseInt radix
▾ #62 String comparison is lexicographic
Medium Type Coercion coercion comparison
▾ #63 Array coercion with plus operator
Hard Type Coercion coercion array
▾ #64 NaN is not equal to anything including itself
Easy Type Coercion nan equality
▾ #65 Object equality is reference-based
Medium Type Coercion equality reference
▾ #66 String spread — unicode-safe character split
Medium Type Coercion spread string
▾ #67 JavaScript Optional Chaining and Nullish Coalescing
Easy Type Coercion
▾ 🔒
62 more questions with progress tracking Free accounts get 5 tracked questions. Pro unlocks all 67+ output questions, debug lab, theory mastery, and the leaderboard.
© 2026 JSPrep Pro · https://jsprep.pro