generate a sequence numbers between a range javascript 1

generate a sequence numbers between a range javascript

Array.from({length: 20}, (x, i) => i);

Here is what the above code is Doing:
1. We create an array of 20 elements.
2. We map each element to its index.
3. We filter out all the even numbers.
4. We double each remaining element.
5. We reduce the array to a single value.

Similar Posts