← Quiz: Scope, Closures, Hoisting and this: all 15 questions
Quiz: Scope, Closures, Hoisting and this · Question 6 of 15
Which kind of scope do let and const have, but var does not?
Which kind of scope do let and const have, but var does not?
- A.Global scope
- B.Function scope
- C.Block scope
- D.Module scope only
Answer & explanation
Correct answer: Block scope
var ignores { } blocks such as if and for; let and const respect them.
Can you get the rest right without peeking?
Take the timed Quiz: Scope, Closures, Hoisting and this quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →