Package Exports
- @extra-array/split-at.min
Readme
Breaks iterable considering indices as separator. 🏃 📼 📦 🌔 📒
This is part of package extra-array.
This is browserified, minified version of @extra-array/split-at.
It is exported as global variable array_splitAt.
CDN: unpkg, jsDelivr.
array.splitAt(x, is);
// x: an array
// is: indices (sorted)
const array = require('extra-array');
var x = [1, 2, 2, 3, 5, 4, 4, 7];
array.splitAt(x, [1, 2, 5, 6]);
// [ [ 1 ], [ 3, 5 ], [ 7 ] ]
var x = [2, 4, 5, 6, 8];
array.splitAt(x, [0, 1, 3, 4]);
// [ [ 5 ] ]