Scope
The scope of a variable is either global or function scope. Block scope (as in other programming languages) do not exist.Remember to declare all variables before used in a function!
How does the java script handle the variable scope?
JavaScript: Scope
JavaScript, Scope
Loading..
Read more about how to avoid to throw errors if variables are undefinedIf you study this code you may learn about:
- How to avoid to throw errors on undefined variables
- The difference between:
- dojo.byId("message").innerHTML/document.ById().innerHTML and
- document.write()
- Use new Object(); to create an object.
- How the scope works in JavaScript