Start value of the sequence.
End value of the sequence (inclusive).
Step size between consecutive values. Must be positive when ascending, negative when descending, and zero only when start equals end.
A sequence of numbers from start to end (inclusive) incremented by step.
Thrown when any parameter is NaN, when step direction doesn't match the start/end relationship, or when step is zero and start doesn't equal end.
Enumeration is deferred. The sequence includes end if it is reachable from start using the given step. For ascending sequences (start < end), step must be positive. For descending sequences (start > end), step must be negative.
const ascending = sequence(1, 10, 1).toArray();
console.log(ascending); // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Generates a numeric sequence from the specified start value to the end value (inclusive) with the given step.