I'm studying underscore delay to better my JS skills, and I'm trying to explain every line to myself to make sure I understand. Could someone explain what this line is doing?
var args = Array.prototype.slice.call(arguments, 2);
Is it taking the first 2 values of the arguments array and making it equal to var 'args'?
also,
shouldn't "wait" be a numerical value like 3000 milliseconds? wondering why it's spelled out?
_.delay = function(func, wait) {
var args = Array.prototype.slice.call(arguments, 2);
setTimeout(function(){
func.apply(this, args);
}, wait);
};