Return an array with the results of invoking mapFn for each index.
mapFn
a non-negative integer
a function that returns the value for each index
an array of length n
n
Three times.
import { times } from "@trashpanda001/helpers/array"times(3)// [0, 1, 2]times(3, (i) => i * i)// [0, 1, 4] Copy
import { times } from "@trashpanda001/helpers/array"times(3)// [0, 1, 2]times(3, (i) => i * i)// [0, 1, 4]
Return an array with the results of invoking
mapFn
for each index.