Created
January 3, 2019 11:39
-
-
Save vivektikar25/b4f3cf518c4f8035194317ca26a86673 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 firstName = "John"; | |
function foo(){ | |
var firstName = "David"; | |
lastName = "Sheriff"; | |
function bar(){ | |
var lastName = "Stone"; | |
firstName = "Nicola" | |
} | |
bar(); | |
console.log(firstName); // Nicola | |
} | |
foo(); | |
console.log(firstName); // John | |
console.log(lastName); // Sheriff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment