HomeQuizzesJavaScriptJavaScript Intermediate
intermediateJS-INT-001

JavaScript Intermediate

5 questions  ·  JavaScript  ·  intermediate level

📝5 questions
No time limit
🔄Retake anytime
Instant feedback

Preview questions

1
Multiple Choice

What does this output?

function counter() {
  let count = 0
  return {
    increment: () => ++count,
    decrement: () => --count,
    value: () => count,
  }
}
const c = counter()
c.increment()
c.increment()
c.decrement()
console.log(c.value())
A
B
C
D
🔒 Sign in to answer and see explanation
2
Multiple Choice

What is logged?

console.log('1')
Promise.resolve().then(() => console.log('2'))
console.log('3')
A
B
C
D
🔒 Sign in to answer and see explanation
3
Spot the Bug

This function should fetch user data. Spot the bug:

async function getUser(id) {
  const res = fetch(`/api/users/${id}`)
  const data = await res.json()
  return data
}
A
B
C
D
🔒 Sign in to answer and see explanation
+ 2 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 5 questions, track your progress, and unlock AI-powered personalization.

← Browse all JavaScript quizzes