This file contains 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
let days = 7; | |
days = 5; | |
console.log(days) | |
// 5 |
This file contains 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
function unitedStates(){ | |
let drinkingAge = 21; | |
} | |
function passDrinkingLaw(){ | |
drinkingAge = 18; | |
// this would throw an error | |
} | |
passDrinkingLaw(); |
This file contains 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
function unitedStates(){ | |
let drinkingAge = 21; | |
function passDrinkingLaw(){ | |
drinkingAge = 18; | |
// when this function runs, it changes the | |
//variable for the whole united states function | |
} | |
} |
This file contains 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
function unitedStates(){ | |
let drinkingAge = 21; | |
let state = 'massachusetts'; | |
if(state == 'massachusetts'){ | |
let closingTime= '2AM'; | |
console.log(drinkingAge) //21 | |
console.log(closingTime) // 2AM | |
} | |
This file contains 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
function unitedStates(){ | |
let drinkingAge = 21; | |
let state = 'massachusetts'; | |
if(state == 'massachusetts'){ | |
let closingTime= '2AM'; | |
console.log(drinkingAge) //21 | |
} | |
console.log(closingTime) //undefined |
This file contains 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
function unitedStates(){ | |
let drinkingAge = 21; | |
} | |
function mexico(){ | |
let drinkingAge = 18; | |
console.log(drinkingAge) //18 | |
} | |
console.log(drinkingAge) |
This file contains 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
const unLawOne = 'Slavery is prohibited'; | |
const unLawTwo = 'Chemical weapons are prohibited'; | |
function unitedStates() { | |
let drinkingAge = 21; | |
console.log(drinkingAge) // 21 | |
console.log (unLawOne) // Slavery is prohibted | |
} | |
console.log(drinkingAge) |
This file contains 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
function unitedStates(){ | |
let drinkingAge = 21; | |
} |
This file contains 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
const unLawOne = 'Slavery is prohibited'; | |
const unLawTwo = 'Chemical weapons are prohibited'; |
This file contains 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
var unLawOne = 'Slavery is prohibited'; | |
var unLawTwo = 'Chemical weapons are prohibited'; |