Skip to content

Instantly share code, notes, and snippets.

@LucaLanziani
Last active August 29, 2015 14:08
Show Gist options
  • Save LucaLanziani/3de6268c76dc119d94d0 to your computer and use it in GitHub Desktop.
Save LucaLanziani/3de6268c76dc119d94d0 to your computer and use it in GitHub Desktop.
underscore delay
function delay() {
var func = Array.prototype.shift.call(arguments);
var time = Array.prototype.shift.call(arguments);
var args = arguments;
var _delay = function () {
func.apply(null, args);
}
setTimeout(_delay, time);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment