Advertisement
Guest User

Agnostic ECMA Range Implementation V2

a guest
Nov 15th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const xRange = (min, max, step) => {
  2.   step = step || 1;
  3.   const { low, high } = (max > min) ? { low: min, high: max } : { low: max, high: min };
  4.   return [...Array(Math.ceil(((high-low)+1)/step)).keys()].map((x) => (x * step) + low)
  5. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement