1 min read
❤️ 2 · 💬 3
#day24
#javascript
#100daysofcode
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");
NOTE: 🤔 Attempting epic advanced-level question. Failure? Nah, fun exploration! Feel the process!😂
Check the comment below to feel more. 🤣🤣🤣
Originally published on DEV Community . Read the discussion and share your thoughts there.
