HomeQuizzesJavaScriptScope & Hoisting
beginnerJS-BEG-002

Scope & Hoisting

10 questions  ·  JavaScript  ·  beginner level

📝10 questions
No time limit
🔄Retake anytime
Instant feedback

Preview questions

1
Multiple Choice

What is the output?

console.log(x)
var x = 5
A
B
C
D
🔒 Sign in to answer and see explanation
2
Multiple Choice

What does this output?

console.log(x)
let x = 5
A
B
C
D
🔒 Sign in to answer and see explanation
3
Multiple Choice

What is logged?

function foo() {
  if (true) {
    var x = 10
    let y = 20
  }
  console.log(x)
  console.log(y)
}
foo()
A
B
C
D
🔒 Sign in to answer and see explanation
+ 7 more questions
Sign in to attempt the full quiz
Free · No credit card required

Ready to attempt the full quiz?

Sign in to attempt all 10 questions, track your progress, and unlock AI-powered personalization.

← Browse all JavaScript quizzes