Underscore.js _.times() Function
The _.times() function in underscore.js is used to call the function a particular number of times i.e. execution of a function(f) “n” number of times.
Note: It is very necessary to link the underscore CDN before going and using underscore functions in the browser. When linking the underscore.js CDN link, the “_” is attached to the browser as a global variable.
Parameters:It takes following parameters:
- n: It tells how many times a function is needed to be executed.
- iteratee : It is a function that is to be invoked n times.
Return Value: It produces an array of returned values and this array is returned by the function.