🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Global scope
  2. B.Function scope
  3. C.Block scope
  4. 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 →