The _.delay() method is used to call the given function as the parameter after the stated wait time is over, which is in milliseconds. Any further arguments are provided to the function when it is called.
_.delay( func, wait, args )
Parameters: This method accepts three parameters as mentioned above and described below:
- func: It is the function that has to be delayed.
- wait: It is the number of milliseconds for which the function call is delayed.
- args: It is the arguments with which the given function is being called. It is an optional parameter.
Return Value: This method returns the timer id.
Example 1: In this example, the content is printed after the delay of 3 seconds as the wait time is 3 seconds.
Example 2: In this example, each integer is printed after a delay of 2 seconds.
Integers are as follows: 1 2 3 4 5
- p5.js Image delay() Method
- CSS | animation-delay Property
- jQuery | delay() with Examples
- CSS | transition-delay Property
- Underscore.js | _.delay() with Examples
- Lodash _.method() Method
- Lodash _.sneq() Method
- Lodash _.toQuery() Method
- Lodash _.uniqWith() Method
- Lodash _.xorWith() Method
- Lodash | _.head() Method
- Lodash | _.remove() Method
- Lodash | _.pullAt() Method
- Lodash | _.pullAll() Method
- Lodash | _.pull() Method
- Lodash | _.nth() Method
- Lodash | _.takeRight() Method
- Lodash | _.take() Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.