Skip to content

JavaScript quiz

Review JavaScript essentials including async code, closures, modules, DOM, and performance.

Frontend · About 3 minutes

What does a Promise represent in JavaScript?

Exit quiz

Question 1 of 5

JavaScript quiz questions and answers

Review all 5 questions at your own pace. Open each answer to see the correct response and a concise explanation of the concept.

Topics covered

  • Promises
  • Closures
  • Block scope
  • Event delegation
  • Main-thread performance

Related developer quizzes

What does a Promise represent in JavaScript?

Correct answer

A future async result

Promises represent asynchronous work that may resolve or reject later.

What is a closure?

Correct answer

A function retaining access to its outer scope

Closures let functions use variables from the scope where they were created.

Which keyword declares a block-scoped variable?

Correct answer

let

let and const are block-scoped, while var is function-scoped.

What does event delegation rely on?

Correct answer

Event bubbling

Event delegation attaches one handler to a parent and handles events bubbled from children.

What can block user interactions in the browser?

Correct answer

Long-running JavaScript on the main thread

Heavy synchronous JavaScript prevents the browser from responding quickly to input.

Build something great with a JavaScript expert.

Need a teammate, not a test?