Message from JavaScript discussions
July 2017
— A variable declaration is a directive to the parser to compute a scope and set a pointer to undefined
for that variable until the line gets executed
So var thing = "hello"
, upon entry into a function call, runs code that allocates thing
with undefined
, then when it gets executed it simply swaps the pointer to the location in memory where the string is allocated
— They're tagged pointers carrying the name of the variable, too
— So yes... you would be able to look at this during run time if we are provided an abstraction to the hash
property
— You could look into the future, man
— And know, somewhere ahead of the current executing statement, there is a variable being declared but not allocated yet (due to not being executed yet)
— You could perhaps, at the top of your functions, get a list of all the variables being declared
— This is especially powerful after a function finished executing too, since if you use that abstraction on a function after the fact, you could also see the same information from the outside
— How to prevent the zoom in website ? f.e :- facebook.com on android browser. any tip pls ?
— It is perhaps default behaviour of js, hoisting
— Exactly, this is how hoisting works
— Currently JS provides us with very inconsistent ways of determining if a variable is undeclared versus unassigned... you are forced into relying on a reference error