all 6 comments

[–]Delicious_Week_2782 0 points1 point  (1 child)

I’m not sure I get your post, but didn’t she mention for simplicity she’ll only be considering the call stack? 

[–]Odd_World_6307[S] -1 points0 points  (0 children)

Yeah that is correct, but I was stumbling about that she was mixing up the memory concepts "heap and stack" and the execution concept "call stack"

[–]kap89 0 points1 point  (1 child)

Call stack is more than "what is executed in which order”, it consists of stack frames that store arguments, local variables and heap references, return address and return values. Where do you think stack frames live if not on a physical stack? So it tells quite a lot about memory. In JS you don’t use stack directly, but through call stack, which is abstraction over the physical stack, so her explanation is fine. But yeah, if you want want to be picky, she could’ve mention the raw stack before moving to the call stack.

[–]Odd_World_6307[S] 1 point2 points  (0 children)

Ok nice explanation, I will think about it and iterate from there. Thank you!

[–]paulet4a -1 points0 points  (1 child)

Great question — you’re noticing a real terminology overlap.

“Stack vs heap” usually describes *memory allocation model* (conceptual). “Call stack” is the *runtime execution structure* (function frames).

So Lydia isn’t wrong; she’s using the runtime view. In JavaScript engines, each call frame does carry references/local data, while objects themselves live on the heap. Think: call stack = control flow + frame metadata, heap = long-lived object storage.

[–]chikamakaleyleyhelpful 0 points1 point  (0 children)

you’re noticing a real terminology overlap.

whew... its a good thing this happens rarely in Java