![]() |
VOOZH | about |
Underscore.js_.times() function is used to call the function a particular number of times i.e. execution of a function(f) "n" times.
NOTE: It is very necessary to link the underscore CDN before going and using the underscore functions in the browser. When linking the underscore.js CDN link, the "_" is attached to the browser as a global variable.
_.times(n, function);It produces an array of returned values and this array is returned by the function.
Example 1: The below code example shows the basic implementation of the _.times() method of underscore.js.
Output:
👁 ImageExample 2: The below code example is another practical implementation of the _.times() method.