Search...

range

declare function range(start: number, end: number, step?: number): number[];
declare function range(start: number, end: number, step?: number): number[];
Yields the numbers in the given range as an array
Example
Basic range
range(3, 5); // [3, 4, 5]
range(3, 5); // [3, 4, 5]
Example
Range with a step
range(3, 10, 2); // [3, 5, 7, 9]
range(3, 10, 2); // [3, 5, 7, 9]
NameTypeOptionalDescription
startnumberNoThe start of the range
endnumberNoThe end of the range (inclusive)
stepnumberYesThe amount to increment between each number