26.3 Memory
Like any programming language, JavaScript must store the values of variables somewhere. Strictly speaking, this “somewhere” is an area of the memory. JavaScript is a language that tries to hide a lot of rather machine-based problems from you. Among other things, this includes memory management. For example, JavaScript has a garbage collector that releases memory that has been used but is no longer in use, while you have no way to control this from within your application. Likewise, you don’t have direct access to memory addresses.
On the other hand, you can influence the storage of data and the garbage collector indirectly. The key to this lies in the scoping of JavaScript, that is, the validity of variables. The language standard ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access