What is the difference between microtasks and macrotasks in the JavaScript event loop?

JavaScript Developer Hard

JavaScript Developer — Hard

What is the difference between microtasks and macrotasks in the JavaScript event loop?

Key points

  • Microtasks run before macrotasks in the event loop
  • Microtasks include Promises and MutationObserver
  • Macrotasks include setTimeout and I/O operations

Ready to go further?

Related questions