@extra-array/split.min
TypeScript icon, indicating that this package has built-in type declarations

2.10.19 • Public • Published

Breaks array considering test as separator. 📦 😺 🏃 📼 🌔 📜 📰 📘

Alternatives: split, splitAt.
Similar: cut, split, group.

This is part of package extra-array.

This is browserified, minified version of @extra-array/split.
It is exported as global variable array_split.
CDN: unpkg, jsDelivr.


array.split(x, fn);
// x:  an array
// fn: test function (v, i, x)
const array = require("extra-array");

var x = [1, 2, 2, 3, 5, 4, 4, 7];
array.split(x, v => v % 2 === 0);
// [ [ 1 ], [ 3, 5 ], [ 7 ] ]

var x = [2, 4, 5, 6, 8];
array.split(x, v => v % 2 === 0);
// [ [ 5 ] ]


References

Readme

Keywords

Package Sidebar

Install

npm i @extra-array/split.min

Weekly Downloads

0

Version

2.10.19

License

MIT

Unpacked Size

5.58 kB

Total Files

8

Last publish

Collaborators

  • wolfram77