The start of the range (inclusive).
The end of the range (exclusive).
The steps of the numbers. Defaults to 1. Setting step to 0 will make the list infinite.
The list of numbers in the range.
expect(toArray(range(0, 5))).toStrictEqual([0, 1, 2, 3, 4]);
expect(toArray(range(0, 5, 0.5))).toStrictEqual([
0,
0.5,
1,
1.5,
2,
2.5,
3,
3.5,
4,
4.5,
]);
expect(toArray(range(2, 3))).toStrictEqual([2]);
expect(toArray(range(3, 6))).toStrictEqual([3, 4, 5]);
expect(toArray(range(3, 3))).toStrictEqual([]);
expect(toArray(range(5, 0))).toStrictEqual([]);
expect(toArray(range(3, 2))).toStrictEqual([]);
Creates the list of numbers from
starttoendwith stepping, adding bystep.