Step 1 of 6
Two kinds of storage
JavaScript uses two areas of memory. The stack keeps track of function calls and their local variables. The heap stores objects. The garbage collector only cleans up the heap.
What to notice
The JavaScript spec never mentions a stack or a heap. They describe how engines like V8 work, and that's the model interviewers expect you to use.
The code
Practice for your next interview
290+ interview questions, a frontend system design guide with case studies, premium roadmaps, AI code reviews, and much more.
Explore more →Stack vs heap
Stack
Heap
questionId
402
isPremium
true
slug
ref
question
ref
tags
ref
"debounce"●STRING
Question●ALIVE
slug:"debounce"
difficulty:"medium"
Array(2)●ALIVE
0:"react"
1:"closures"
01 / 06
Space to advance · ← → to step



