Variable: first()
const
first: <Value
>(iterable
) =>Optional
<Value
>
Defined in: splices.d.ts:381
Returns an iterable containing the first value of iterable
, or an empty
iterable if iterable
is empty.
Type Parameters
Value
Value
Parameters
iterable
Iterable
<Value
>
Returns
Optional
<Value
>
Example
console.log(
pipe(
[`sloth`, `more sloth`, `even more sloth`],
first,
reduce(toArray()),
),
)
//=> [ 'sloth' ]
Since
v0.0.1