Need private packages and team management tools?Check out npm Teams »

just-split-at

2.1.0 • Public • Published

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 now

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); // undefined
splitAt(undefined, 1); // undefined

Install

npm i just-split-at

DownloadsWeekly Downloads

3

Version

2.1.0

License

MIT

Unpacked Size

2.61 kB

Total Files

4

Last publish

Collaborators

  • avatar