Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Block scope
- if (true) {
- var name = 'John';
- let address = 'Hawaii'
- }
- console.log(name)
- console.log(address) // error
- // Function scope
- setTimeout(function(){
- var age = '100'
- }, 2000)
- console.log(age) // error
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement