Breaks an array into an array of arrays. The indices are where each new array begins.
indices
Negative indices count backwards from the end of the array. Returns null if any index is fractional or NaN.
import * as A from "flurp/array";const splitFirstAndLastPairs = A/split(2, -2);splitFirstAndLastPairs([0, 1, 2, 3, 4, 5, 6, 7]); // [[0, 1], [2, 3, 4], [6, 7]]
Breaks an array into an array of arrays. The
indices
are where each new array begins.Remarks
Negative indices count backwards from the end of the array. Returns null if any index is fractional or NaN.
Example