import * as A from "flurp/array";
A.createRange(2, 22, { points: 5 }); // [2, 7, 12, 17, 22]
A.createRange(2, 22, { intervals: 5 }); // [2, 6, 10, 14, 18, 22]
A.createRange(2, 22, { space: 4 }); // [2, 6, 10, 14, 18, 22]
A.createRange(2, 22, { space: 4.1 }); // [2, 6, 10, 14, 18, 22]
Creates an array of equally spaced numbers from
starttoend. You may control the spacing or number of points by setting any of the following:n.intervalse.g., [1, 2, 3] would have two intervals--1 to 2 and 2 to 3 (minimum 1).n.pointsto set the total number of points (minimum 2)n.spaceto set the difference between successive points. Ifend - startdoes not divide evenly byn.space, thenn.spacewill automatically be adjusted to allow even spacing.If the value of
nis not valid, then an empty array will be returned.