Question · JavaScript and TypeScript course · Module 8: Events and the DOM

Passive Event Listeners

What does the { passive: true } option mean in addEventListener?

Answer options

  • The listener will be automatically removed after the first invocation
  • The listener will not call preventDefault(), which improves scrolling performance
  • The listener will only work in the capture phase
  • The listener will be invoked with a 100ms delay

You can check the correct answer by solving this task in the CodeWorlds game.