I’ve been playing with JavaScript a lot more lately, and this course that I am taking has constantly emphasized the importance of knowing JavaScript from the inside out.
So, I have such a strange question, basically I'm just trying to figure out how JavaScript works inside.
Let's say I do the following calculation in the console:
>> x = 1
< 1
>> x = x + 2
< 3
"3", which returns to where it comes from for sure?
How does he first evaluate "x + 2" and then return 3 and set the x value in memory to 3? Or will it evaluate "x + 2", store it in memory x, and then return the value x from the same memory space?
Or maybe just change the value of x in your memory space without moving it, and then return the value of x?
I would also appreciate any source on how I could learn more about the inner workings of JavaScript to answer other questions like these.
Thank!
source
share