1
let num = 10;
console.log(num);

For example, if the value 10 stored at 0x123..

How does javascript recognize that the string "num" is associated with the address 0x123.. which contains the value 10?

I found an explanation about this process in C, basically the compiler discards the name and substitutes it with the address (the name of the variable is not preserved). Is it the same for javascript?

I am confused because javascript is different, it's just-in-time compiled. Every browser vendor probably implements their own version of this but I imagine that they share the same concepts.

Does this mean that it maintains a symbol table at all times to keep track of the relationship between the variable name and its address location?

I skimmed through the ECMA specs and read the MDN documentation and I am still lost.

0 Answers0