Asynchronous Callbacks

  • Some tasks in the browser take a long time to complete
  • Some tasks involve a period of waiting
  • For the types of tasks that could fit both criteria, JS uses callbacks
  • Don't pause everything while tasks finish
  • The browser is "idle" while tasks complete and other things can happen
  • This means the browser does not need to freeze during "waiting" time

15 / 27