Last active
September 23, 2023 09:51
-
-
Save mislav/e6d8eaa76dab5baf7dd1 to your computer and use it in GitHub Desktop.
Overwrite setTimeout so it optionally accepts the delay as 1st argument
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var _ = window.setTimeout | |
window.setTimeout = function(delay, fn) { | |
return (typeof delay == "number") ? _(fn, delay) : _(delay, fn) | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment