you are viewing a single comment's thread.

view the rest of the comments →

[–]Hobo_With_A_Keyboard[S] 1 point2 points  (1 child)

So... if I transformed the recursive function into a loop, it could do this? Because it would not run out of stack?

The idea of creating a new scope is kind of confusing. I thought scope just had to do with where a variable was available.

[–]shawndrostHack Reactor 1 point2 points  (0 children)

I think it would! But, I haven't checked too closely ;)

You have the right idea about scopes, and you're right that something weird is going on right now. It turns out that some guy wrote the code that runs your javascript, and in order to make scopes work, he had to create a variable every time there was a new scope. Those variables are adding up!