3.2.0 • Published 1 year ago

just-split-at v3.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
1 year ago

just-split-at

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-split-at
yarn add just-split-at

Splits an array into two at a given position

import splitAt from 'just-split-at';

splitAt([1, 2, 3, 4, 5], 2); // [[1, 2], [3, 4, 5]]
splitAt([{a: 1}, {b: 1}, {c: 1}], -1); // [[{a: 1}, {b: 1}], [{c: 1}]]
splitAt([], 2); // [[], []]
splitAt(null, 1); // throws
splitAt(undefined, 1); // throws
3.2.0

1 year ago

3.1.1

2 years ago

3.1.0

2 years ago

3.0.1

2 years ago

3.0.0

3 years ago

2.3.0

3 years ago

2.3.1

3 years ago

2.2.0

3 years ago

2.1.0

6 years ago

2.0.0

7 years ago

1.0.0

7 years ago