Last active
March 26, 2018 18:28
-
-
Save aryak007/75b2c026c3a37c2e316ec529e0eb7519 to your computer and use it in GitHub Desktop.
Closures First Example
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
| function outer(){ | |
| var stark = "The king in the North, Jon Snow"; | |
| function inner(){ | |
| console.log(stark); | |
| } | |
| anotherFunction(inner); | |
| } | |
| function anotherFunction(inner){ | |
| inner(); //Q1. What is happening over here? | |
| } | |
| outer() //Q2. What will be the output? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment