Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 669 Bytes

README.md

File metadata and controls

20 lines (15 loc) · 669 Bytes

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