⚡ Predict the Output

JavaScript Output Questions
What Does This Code Print?

66+ real JavaScript output prediction questions from frontend interviews. Read code → predict console.log → learn why.

66 questions  ·  ✅ First 5 interactive free  ·  ✅ Progress saved in quiz

Practice Free →Browse Questions ↓

⚡ 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.

⚙️

Event Loop & Promises

16 questions

#01

Classic setTimeout vs Promise

🟡 MediumEvent Loop & Promisesevent-loopmicrotask
#02

Nested setTimeout and Promise

🔴 HardEvent Loop & Promisesevent-loopmicrotask
#03

async/await execution order

🟡 MediumEvent Loop & Promisesasync-awaitmicrotask
#04

Promise chaining order

🔴 HardEvent Loop & Promisespromisethen-chain
#05

Promise constructor is synchronous

🟡 MediumEvent Loop & Promisespromiseconstructor
#06

async/await vs .then chain

🔴 HardEvent Loop & Promisesasync-awaitpromise
#07

Multiple awaits

🔴 HardEvent Loop & Promisesasync-awaitmicrotask
#08

queueMicrotask vs Promise

🔴 HardEvent Loop & PromisesmicrotaskqueueMicrotask
#09

Promise.all ordering

🟡 MediumEvent Loop & Promisespromise-allorder
#10

Generator execution order

🟡 MediumEvent Loop & Promisesgeneratoryield
#11

Generator two-way communication

🔴 HardEvent Loop & Promisesgeneratoryield
#12

requestAnimationFrame vs setTimeout order

🔴 HardEvent Loop & PromisesrequestAnimationFramesettimeout
#13

async/await with rejection

🔴 HardEvent Loop & Promisesasyncawait
#14

Custom iterable with for...of

🟡 MediumEvent Loop & Promisesiterablesymbol-iterator
#15

Promise rejection in async generator

🔴 HardEvent Loop & Promisesasync-generatorfor-await
#16

Promise.all vs sequential await performance

🔴 HardEvent Loop & Promisespromise-allsequential
🔒

Closures & Scope

19 questions

#17

Classic var in loop closure

🟢 EasyClosures & Scopeclosurevar
#18

let in loop closure (fix)

🟢 EasyClosures & Scopeclosurelet
#19

Closure counter

🟡 MediumClosures & Scopeclosurecounter
#20

IIFE closure

🟡 MediumClosures & Scopeclosureiife
#21

Closure variable lookup

🔴 HardClosures & Scopeclosurescope-chain
#22

Shared closure mutation

🔴 HardClosures & Scopeclosureshared-reference
#23

Block scope with let

🟡 MediumClosures & Scopeblock-scopelet
#24

Module pattern with closure

🔴 HardClosures & Scopeclosuremodule
#25

Scope chain lookup

🟡 MediumClosures & Scopescopescope-chain
#26

Block scope vs function scope

🟡 MediumClosures & Scopeletvar
#27

Temporal Dead Zone with let

🔴 HardClosures & Scopetdzlet
#28

Closure in object methods

🟡 MediumClosures & Scopeclosureobject
#29

Map key reference equality

🟡 MediumClosures & Scopemapreference
#30

Set uniqueness rules

🟡 MediumClosures & Scopesetunique
#31

Nested object destructuring with defaults

🟡 MediumClosures & Scopedestructuringdefaults
#32

Spread vs rest in different positions

🔴 HardClosures & Scopespreadrest
#33

Object spread override order

🟡 MediumClosures & Scopespreadobject
#34

Module pattern with revealed state

🟡 MediumClosures & Scopemodule-patterniife
#35

WeakMap with garbage collectible keys

🔴 HardClosures & Scopeweakmapgc
👉

'this' Binding

11 questions

#36

Method extracted from object

🟡 Medium'this' Bindingthismethod
#37

Arrow function this

🟡 Medium'this' Bindingthisarrow-function
#38

this in nested function

🔴 Hard'this' Bindingthisnested
#39

bind creates new function

🔴 Hard'this' Bindingthisbind
#40

setTimeout this loss

🟡 Medium'this' Bindingthissettimeout
#41

this in class methods

🔴 Hard'this' Bindingthisclass
#42

call chain with this

🔴 Hard'this' Bindingthiscall
#43

new binding creates fresh object

🟡 Medium'this' Bindingthisnew
#44

Chained method calls and this

🔴 Hard'this' Bindingthismethod-chaining
#45

Proxy get trap intercepts access

🔴 Hard'this' Bindingproxyget-trap
#46

Prototype chain property lookup

🔴 Hard'this' Bindingprototypechain
🚀

Hoisting

8 questions

#47

var hoisting

🟢 EasyHoistinghoistingvar
#48

Function declaration hoisting

🟢 EasyHoistinghoistingfunction-declaration
#49

Function expression not hoisted

🟡 MediumHoistinghoistingfunction-expression
#50

let temporal dead zone

🟡 MediumHoistinghoistinglet
#51

Function vs var hoisting order

🔴 HardHoistinghoistingfunction
#52

Hoisting inside blocks

🔴 HardHoistinghoistingblock
#53

Class declaration hoisting (TDZ)

🔴 HardHoistinghoistingclass
#54

Hoisting with default exports and imports

🟡 MediumHoistingesmoduleshoisting
🔀

Type Coercion

12 questions

#55

Loose equality coercion

🟢 EasyType Coercioncoercionequality
#56

Addition vs concatenation

🟡 MediumType Coercioncoercionaddition
#57

Falsy values comparison

🟡 MediumType Coercioncoercionfalsy
#58

NaN comparison

🟡 MediumType Coercioncoercionnan
#59

Object to primitive coercion

🔴 HardType Coercioncoercionobject
#60

Unary plus operator

🔴 HardType Coercioncoercionunary
#61

Comparison coercion

🟡 MediumType Coercioncoercioncomparison
#62

Tricky array coercion

🔴 HardType Coercioncoercionarray
#63

Symbol coercion rules

🔴 HardType Coercionsymbolcoercion
#64

Default parameter coercion

🟡 MediumType Coerciondefault-paramsundefined
#65

Symbol.toPrimitive custom coercion

🔴 HardType Coercionsymbol-toprimitivecoercion
#66

Optional chaining with nullish coalescing

🟡 MediumType Coercionoptional-chainingnullish-coalescing
🔒

61 more questions with progress tracking

Free accounts get 5 tracked questions. Pro unlocks all 66+ output questions, debug lab, theory mastery, and the leaderboard.

⚡ Start Free — 5 QuestionsView Pro — $9/mo →

Related Resources