Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function unitedStates(){
let drinkingAge = 21;
let state = 'massachusetts';
if(state == 'massachusetts'){
let closingTime= '2AM';
console.log(drinkingAge) //21
console.log(closingTime) // 2AM
}
if(state == 'newYork'){
let closingTime= '4AM';
console.log(closingTime) // 4AM
}
console.log(closingTime) //undefined
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment