Skip to content

Commit 9f1fa7c

Browse files
committed
Added and completed "delay" for Underbar.
1 parent 5cfc980 commit 9f1fa7c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/underbar.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,10 @@ var _ = {};
333333
// parameter. For example _.delay(someFunction, 500, 'a', 'b') will
334334
// call someFunction('a', 'b') after 500ms
335335
_.delay = function(func, wait) {
336+
var args=Array.prototype.slice.call(arguments, 2);
337+
setTimeout(function() {
338+
func.apply(this, args);
339+
}, wait);
336340
};
337341

338342

0 commit comments

Comments
 (0)