We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Break array when test passes.
Alternatives: cut, cutRight. Similar: cut, split, group.
function cut(x, ft) // x: an array // ft: test function (v, i, x)
const xarray = require('extra-array'); var x = [1, 2, 3, 4, 5]; xarray.cut(x, [1, 3]); // → [ [ 1 ], [ 2, 3 ], [ 4, 5 ] ] xarray.cut(x, [0, 4]); // → [ [], [ 1, 2, 3, 4 ], [ 5 ] ]