Created
November 2, 2012 14:41
-
-
Save almonk/4001753 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(i) { | |
'use strict'; | |
console.log(i); // undefined | |
console.log(bar); // function | |
console.log(animals); // undefined | |
console.log('-------------------------'); | |
var i = 2; | |
var bar = 'cool'; | |
function bar() { | |
return 'yey'; | |
} | |
var animals = function foo() { | |
return 'cats'; | |
}; | |
console.log(i); // 2 | |
console.log(bar); // cool | |
console.log(animals); // function | |
console.log(foo); // reference error, foo undefined | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment