Created
July 17, 2015 09:07
-
-
Save eliOcs/5ead123b33954f3d99e2 to your computer and use it in GitHub Desktop.
This example tries to explain the function scope of javacript.
This file contains hidden or 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
/*jslint node: true, maxlen: 80, indent: 4 */ | |
"use strict"; | |
var paco = "paco"; | |
function fun1(paco) { | |
console.log(paco); | |
} | |
function fun2() { | |
var paco = "francisco"; | |
return function fun3() { | |
console.log(paco); | |
}; | |
} | |
console.log(paco); | |
fun1("kiko"); | |
fun2()(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment