Variable: last()
const
last: <Value
>(iterable
) =>Optional
<Value
>
Defined in: splices.d.ts:448
Returns an iterable containing the last 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`],
last,
reduce(toArray()),
),
)
//=> [ 'even more sloth' ]
Since
v0.0.1