npm.io
8.14.0 • Published 5 years ago

@unction/takefirst

Licence
SEE LICENSE IN LICENSE
Version
8.14.0
Deps
4
Size
19 kB
Vulns
0
Weekly
0

@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"