@unction/takefirst
v8.14.0
Published
Returns the first N of a list of ordered values
Downloads
80
Readme
@unction/takeFirst
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"