Created
September 6, 2018 05:05
-
-
Save praveen-me/5dcbf7f4b88b4409f0e0deade640da87 to your computer and use it in GitHub Desktop.
Scopes in JavsScript
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 num1 = 5; //globally | |
function add() { | |
var num2 = 8; //locally | |
return function() { //returning function | |
return num1 + num2; //returning function | |
} //returning function | |
} | |
var addIt = add(); | |
addIt(); //? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment