JavaScript Sequential Array

J

Makes an JavaScript array from n to m, where n is the start number, and m is end number.

function sequentialArray (startValue, endValue) {
  return new Array(endValue - startValue + 1).fill('').map((v, i) => (i + startValue));
}

About the author

By mark

Recent Posts

Categories