HomeQuizzesJavaScriptFunctions & Closures
beginnerJS-BEG-003

Functions & Closures

10 questions  ·  JavaScript  ·  beginner level

📝10 questions
No time limit
🔄Retake anytime
Instant feedback

Preview questions

1
Multiple Choice

What is a closure in JavaScript?

A
B
C
D
🔒 Sign in to answer and see explanation
2
Multiple Choice

What does this output?

function makeAdder(x) {
  return function(y) {
    return x + y
  }
}
const add5 = makeAdder(5)
console.log(add5(3))
A
B
C
D
🔒 Sign in to answer and see explanation
3
Multiple Choice

What is printed?

function outer() {
  let count = 0
  return function() {
    count++
    return count
  }
}
const inc = outer()
console.log(inc())
console.log(inc())
console.log(inc())
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