![]() |
VOOZH | about |
_.before() function in underscore.js is used to call a particular function a particular number of times. It uses a count variable that keeps the track of number of times the function is called.
Syntax:
_.before(count, function)
Parameters:
Return: This function returns the count of the function call.
Note: Please Link the underscore CDN before using this code directly in the browser through the code.
Example 1:
Output:
Example 2:
It is clear from the example that if The button is clicked again and again then print function will not be working as it as already reached the count.
Output: