Created
December 25, 2011 15:48
-
-
Save sri-rang/1519445 to your computer and use it in GitHub Desktop.
Functional Programming in JavaScript - 3
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 (name) { | |
console.log(name + " functions can be auto-executed on definition") | |
})("Anonymous"); | |
console.log("JavaScript provides functional scoping instead of block scoping"); | |
(function () { | |
if (true) { | |
var x = true; | |
console.log("Is 'x' available inside the block? " + x); | |
} | |
console.log("Is 'x' available outside the block? " + x); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment