Invokes a function n times, passing the current index on each call.
n
Number of times to invoke the function.
Function to execute, receives the current index as argument.
times(3, (i) => console.log(i));// Output:// 0// 1// 2 Copy
times(3, (i) => console.log(i));// Output:// 0// 1// 2
1.1.0
Invokes a function
n
times, passing the current index on each call.