Showing posts with label delay. Show all posts
Showing posts with label delay. Show all posts

Friday, April 25, 2014

Lodash: Replacing setTimeout() With delay()

The built-in setTimeout() JavaScript function defers the the execution of a given function till a given number of milliseconds have passed. For the most part, this works perfectly — you pass in a function, and the duration to wait. Things aren't so straightforward when you already have a function defined, and you want to delay it's execution — especially when you want to invoke the function with specific parameters.