A Pen by Alan Moore on CodePen.
Created
August 18, 2017 06:20
-
-
Save anonymous/fa968c131e3c836764ee43b6ff06699d to your computer and use it in GitHub Desktop.
BindingHoistingExceptions
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
// document | |
function test() | |
{ | |
var what = 42; | |
for (i = 0; i < 10; i++) | |
{ | |
console.log("i = " + i); | |
} | |
} | |
test(); | |
try { | |
console.log("typeof what = " + (typeof what) + ", typeof i = " + i); | |
console.log("what = " + what + ", i = " + i); | |
} | |
catch(myError) | |
{ | |
console.log("Error: " + JSON.stringify(myError)); | |
} | |
finally | |
{ | |
console.log("done..."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment