Skip to content

Instantly share code, notes, and snippets.

@rodyhaddad
Last active August 29, 2015 14:04
Show Gist options
  • Save rodyhaddad/a10b03286b23638c4b94 to your computer and use it in GitHub Desktop.
Save rodyhaddad/a10b03286b23638c4b94 to your computer and use it in GitHub Desktop.
function test() {
if (true) {
let x = 1;
}
try{
log(x);
} catch(e){console.log(e)}
if (typeof x !== 'undefined') console.log(x);
// -----------
if (false) {
let y = 1;
}
try{
log(y);
} catch(e){console.log(e)}
if (typeof y !== 'undefined') console. log(y)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment