Created
May 12, 2017 15:40
-
-
Save ar5had/9bf574244f465382bf8ab58ca627d0f1 to your computer and use it in GitHub Desktop.
hack for block scope variables in es5..
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
try { | |
throw 1; | |
} catch (myfancyvariable) { | |
console.log('This variable is only availabe within this catch block =>', myfancyvariable); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment