Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // https://www.freecodecamp.org/news/javascript-range-create-an-array-of-numbers-with-the-from-method/
- const arrayRange = (start, stop, step) =>
- Array.from(
- { length: (stop - start) / step + 1 },
- (value, index) => start + index * step
- );
- console.log(arrayRange(1, 5, 1)); // [1,2,3,4,5]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement