Defers the execution of a function until the next microtask.
Parameters
fn: Function
The function to defer.
Returns void
Example
defer(() =>console.log("Executed after current call stack")); console.log("Executed first"); // Output: // Executed first // Executed after current call stack
Defers the execution of a function until the next microtask.