Understanding stack and frame in javascript
问题 I am brand new to js, and am having trouble understanding what happens in the background. So if I have a recursive js function, do all the recursive calls create a stack frame on the stack? and then get popped off once we return? Is the heap involved in this process? Next the idea of closures. With this I am very confused with where things go does the first function get put on the heap? Any explanation would be greatly appreciated. 回答1: So if I have a recursive js function, do all the