Creates an array of values by running each index of the array through a callback function to initialize its value.
The length of the array to create.
The function to initialize each element.
The created array.
forMap(3, (idx) => idx) // [0, 1, 2]forMap(3, (idx) => idx * 2) // [0, 2, 4]forMap(2, () => 'foo') // ['foo', 'foo'] Copy
forMap(3, (idx) => idx) // [0, 1, 2]forMap(3, (idx) => idx * 2) // [0, 2, 4]forMap(2, () => 'foo') // ['foo', 'foo']
Generated using TypeDoc
Creates an array of values by running each index of the array through a callback function to initialize its value.