Created
March 28, 2018 12:34
-
-
Save aryak007/55ccca1fdebfeadb2a0bc54d281709be 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
var foo = "foo"; | |
(function(){ // Can be named or anonymous | |
var foo= "bar"; | |
console.log(foo); // bar | |
})() | |
console.log(foo) // "foo" | |
//Ex 2 | |
var foo = "foo"; | |
(function(bar){ // Can be named or anonymous | |
var foo= bar; | |
console.log(foo); // foo | |
})(foo) | |
console.log(foo) // "foo" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment