Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.