-
Notifications
You must be signed in to change notification settings - Fork 5
cutRight
Subhajit Sahu edited this page Jun 20, 2020
·
23 revisions
Breaks array after test passes. 🏃 📼 📦 🌔 📒
Alternatives: cut, cutRight, [cutAt], [cutAtRight].
Similar: cut, split, [group].
array.cutRight(x, ft);
// x: an array
// ft: test function (v, i, x)
const array = require('extra-array');
var x = [1, 2, 3, 4, 5];
array.cutRight(x, [1, 3]);
// [ [ 1, 2 ], [ 3, 4 ], [ 5 ] ]
array.cutRight(x, [0, 4]);
// [ [ 1 ], [ 2, 3, 4, 5 ], [] ]