number of executions
function to be executed
Executes a function a specified number of times and collects the results in an array.
const results = forEach(5, i => i * 2);console.log(results); // [0, 2, 4, 6, 8] Copy
const results = forEach(5, i => i * 2);console.log(results); // [0, 2, 4, 6, 8]
number of executions