Invokes the getValue function n times, returning an array of the results.
The return type of the getValue function.
Optional
The number of times to invoke getValue.
The function to invoke for each index.
An array containing the results of invoking getValue n times.
times(3, (i) => i * 2); // => [0, 2, 4]times(2, () => 'es-toolkit'); // => ['es-toolkit', 'es-toolkit'] Copy
times(3, (i) => i * 2); // => [0, 2, 4]times(2, () => 'es-toolkit'); // => ['es-toolkit', 'es-toolkit']
Alias