- Define what scope is
- Explain the three types of scope.
- Explain what hoisting is, and when it occurs
- Identify which scope data is stored in.
Turn your neighbor and explain what scope is. Be prepared share with the class.
Turn to your neighbor and name the three different types of scope
Turn to your neighbor and define hoisting, and when it occurs.
var name = 'Roger' // <- where is this stored?
function toUpper(name){
var upperName = name.toUpperCase() // where are these stored?
return upperName
}
for(var i = 0; i < 10; i++){ // where is `i` stored?
console.log(i)
}
for(let i = 0; i < 10; i++){ // where is `i` stored?
console.log(i)
}