Generates an Array with a given length, and calls a Function for each index to determine it's value.
const result = generate(3, (index) => -index);console.log(result); // [-1, -2, -3]
the generated Array
the Array value type
the Array length
the Function to call for each index
Generated using TypeDoc
Generates an Array with a given length, and calls a Function for each index to determine it's value.
Example
Returns
the generated Array