I am trying to define a function range which takes 3 integer parameters: start, end, and step.
The function should return an array of numbers from start to end counting by step.
It seems very simple, however my code, is incorrect:
const range = function(start, end, step) {
for (let i = start; i <= end; i += step);
return (start, end, step);
}
console.log(range(0, 10, 2));
Why is my code incorrect?
Thank you.