function foo() { | |
var x = 9; | |
if (x > 5) { | |
var x = 7; | |
console.log("Value of x in if statement = " + x); | |
} | |
console.log("Value of x outside if statement = " + x); | |
} | |
foo(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment