Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setGlobal() {
- a = 42;
- }
- function setLocal() {
- var b = 23;
- }
- setGlobal();
- alert(a); // 42
- setLocal();
- alert(b); // ReferenceError: b is not defined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement