Day 24: Async vibes

Dharan Ganesan - Aug 11 '23 - - Dev Community

Today will feel the async vibes! ⏰ with custom timer implementation

Question

Implement polyfill function that simulates the setTimeout using callbacks.

window.mySetTimeout = function(callback, delay) {
  // Todo add your code
};

function delayedFunction() {
  console.log("Delayed function executed");
}

console.log("Start");
mySetTimeout(delayedFunction, 1000);
// Delayed function will be called after approximately 1000ms
console.log("End");
Enter fullscreen mode Exit fullscreen mode

NOTE: 🤔 Attempting epic advanced-level question. Failure? Nah, fun exploration! Feel the process!😂

Check the comment below to feel more. 🤣🤣🤣

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player