Tweakr
    Preparing search index...

    Function defer

    • Defers the execution of a function until the next microtask.

      Parameters

      • fn: Function

        The function to defer.

      Returns void

      defer(() => console.log("Executed after current call stack"));
      console.log("Executed first");
      // Output:
      // Executed first
      // Executed after current call stack

      1.1.0