Function: first()
first<
Value
>(iterable
):Optional
<Value
>
Returns an iterable containing the first value of iterable
, or an empty
iterable if iterable
is empty.
Type Parameters
• Value
Parameters
iterable
Iterable
<Value
, any
, any
>
Returns
Optional
<Value
>
Example
console.log(
pipe(
[`sloth`, `more sloth`, `even more sloth`],
first,
reduce(toArray()),
),
)
//=> [ 'sloth' ]
Since
v0.0.1