How to return an array with the step of the sum of the previous value?
I have an input number that is 1000
I want to get [1000, 2000, 3000 … 10000]
I’m trying to:
const range = (i: number, o: number) => {
const arr = [0, 1, 2, 3, 4].reduce(
(accumulator: any, currentValue: any, index: any, array: any) => {
console.log((array[index] = accumulator + currentValue));
return 1;
},
10000
);
};
range(1000, 10000);