JSPM

@extra-array/cut-right

2.8.66
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 43
  • Score
    100M100P100Q62097F
  • License MIT

Breaks array after given indices.

Package Exports

  • @extra-array/cut-right

Readme

Breaks array after given indices. 🏃 📼 📦 🌔 📒

Alternatives: cut, cutRight.
Similar: cut, split.
This is part of package extra-array.

array.cutRight(x, is);
// x:  an array
// is: split indices (sorted)
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 ], [] ]

references