Sep 12, 2017

When you declare a variable in JavaScript (using "var"), that variable declaration is "hoisted" to the top of the current scope

Meaning the top of the current function or the top of the script if the variable isn't in a function.

Hoisting can cause unexpected behavior, so a good way to keep things clear is to always declare your variables at the top of the scope.
Post a Comment

Featured Post

Keep your API key private.

If someone obtains your key, they could use it to consume your quota or incur charges against your API Console project.