@unction/takefirst
TypeScript icon, indicating that this package has built-in type declarations

8.14.0 • Public • Published

@unction/takeFirst

Tests Stability Dependencies

number => Array | string => Array | string

Returns the first N of a list of ordered values.

takeFirst(2)([1, 2, 3]) // [1, 2]
takeFirst(1)([1, 2, 3]) // [1]
takeFirst(2)("abc") // "ab"
takeFirst(1)("abc") // "a"

Readme

Keywords

Package Sidebar

Install

npm i @unction/takefirst

Weekly Downloads

72

Version

8.14.0

License

SEE LICENSE IN LICENSE

Unpacked Size

19 kB

Total Files

7

Last publish

Collaborators

  • krainboltgreene