6

I am not sure how JavaScript manages its memory and variables.

Is it like .NET where value types are stored on the stack and the type referenced on the heap? Or is everything just saved on the heap? How does it work?

8
  • 1
    See this Commented Nov 8, 2015 at 18:11
  • @melpomene You could Google it or simply read the tag wiki for the [heap-memory] tag which this question is tagged as. Commented Nov 8, 2015 at 18:11
  • 1
    Why is the question closed as too broad? Its quite a specific question.. anyways. I think (pretty sure) that javascript memory is handled by the browser, and the browser could do that in a couple of ways but it probably reserves a selection of its own heap for javascript variables when needed. Commented Nov 8, 2015 at 18:18
  • 2
    It's an implementation detail of the specific JavaScript compiler you care about, so there isn't one true answer. It's also not really a practical problem, which is what Stackoverflow is geared towards. It might be suitable for the programmers stackexchange. Commented Nov 8, 2015 at 18:27
  • 1
    @Quentin: The practical answer would be that we don't need to care or worry about, and cannot control it anyway in a web environment. Commented Nov 8, 2015 at 21:45

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.