function bla() { a=5; }
Does a automatically become a global variable?
And when exactly is it set? when the functions are being read for the first time and put into memory or only at the execution of the function?
If you assign to a variable inside a function without declaring it with var then it becomes a global.
The variable becomes a global when the function is first executed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With