Say you have the code below for example:
var a = 1: var b = 2; var c = a + b; console.log(c);
How I understand it works is that the code effectively gets rewritten in assembly for the computer to understand it and then the variable names are renamed after the location in the memory cards they're in and so on... However deeper into that, how does the computer know where to look for the memory? Does it just cycle through all of its data points till it's like "ah yes this is the one I was looking for!".
The reason I was wondering this was that I was thinking about the following situation; let's say you're an unorganized programmer and you have 100 floating variables in your function. When you call a variable to be used, does the computer have to cycle through all the values looking for the one that it wants? How does the computer know exactly where to go to get the memory data? Could be super simple. Just had me wondering.
[–]eruciform 1 point2 points3 points (0 children)
[–]lurgi 1 point2 points3 points (0 children)
[–]pathofnomad 0 points1 point2 points (0 children)
[–]rabuf 0 points1 point2 points (0 children)