easy - accepted / - tried
window.setTimeout() could be used to schedule some task in the future.
Could you implement
clearAllTimeout() to clear all the timers ? This might be useful when we want to clear things up before page transition.
setTimeout(func1, 10000) setTimeout(func2, 10000) setTimeout(func3, 10000) // all 3 functions are scheduled 10 seconds later clearAllTimeout() // all scheduled tasks are cancelled.
You need to keep the interface of
window.clearTimeout the same, but you could replace them with new logic
Let's try to solve this problem within 15 minutes.