UNPKG

typedash

Version:

modern, type-safe collection of utility functions

26 lines (24 loc) 851 B
/** * Returns an array of numbers from 0 to the specified end value (exclusive). * @param end The end value of the range. * @returns An array of numbers from 0 to the specified end value (exclusive). * @example * ```ts * range(5) // [0, 1, 2, 3, 4] * ``` */ declare function range(end: number): number[]; /** * Returns an array of numbers from the specified start value to the specified end value (exclusive). * @param start The start value of the range. * @param end The end value of the range. * @param step The step between each value in the range. * @returns An array of numbers from the specified start value to the specified end value (exclusive). * @example * ```ts * range(2, 5) // [2, 3, 4] * range(2, 5, 2) // [2, 4] * ``` */ declare function range(start: number, end: number, step?: number): number[]; export { range };