Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function fun(p1) {
console.log(v1);
if(p1){
let v1 = p1;
}
console.log(v1);
{
let v2 = p1 + '_v2';
}
console.log(v2);
}
fun('its fun'); //OUTPUT error v1 is not defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment