Skip to content

Instantly share code, notes, and snippets.

@mislav
Last active September 23, 2023 09:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mislav/e6d8eaa76dab5baf7dd1 to your computer and use it in GitHub Desktop.
Save mislav/e6d8eaa76dab5baf7dd1 to your computer and use it in GitHub Desktop.
Overwrite setTimeout so it optionally accepts the delay as 1st argument
(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