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

Use case for throttle

Which event is best limited with throttle so the function runs e.g. every 100 ms?

Answer options

  • scroll - fires very frequently while scrolling
  • DOMContentLoaded - fires only once
  • submit - fires on form submission
  • load - fires after resources finish loading

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