+ 1
How does JavaScript allocate memory space for its variables?
In Java, a variable name must be declared with any of the primitive data type such as int, short, long, float, double, etc. Each has a specific amount of memory that it can accommodate, like int takes 32 bits of memory and long takes 64 bits(if I'm right). How does JavaScript handle this since most of it's variables are declared with keyword 'var'?
1 ответ
0
Memory is automatically allocated in JS, when objects are created and freed by garbage collection when they are not used anymore.