Memory access in javascript
how is memory accessed in javascript开发者_如何学编程?
Short answer: It's not.
Longer answer: You cannot directly access memory from JavaScript. Of course any objects you create are stored in memory somewhere, and you can access them, but that's it.
Since JavaScript is an interpreted language, there is no single and conclusive answer to this question, except for: Every time you assign or change a variable, and every time you create a function, your JavaScript engine will handle assigning memory for you. The same is true for freeing up memory, when the resources are no longer needed. Every browser comes with its own JavaScript engine, so the way this is done may vary greatly.
JavaScript allocates and frees memory automatically. Furthermore, there's no pointer arithmetic in JavaScript.
精彩评论