starry.first
v4.0.0
Published
Member of the starry suite—modular functions for iterable objects.
Downloads
4
Maintainers
Readme
Member of the starry suite—modular functions for iterable objects.
Status
Applies to the whole suite.
Usage
function first<T = any>(iterable: Iterable<T> = []): T | undefined
Returns the first element of an iterable.
Returns undefined
if the iterable has no elements.
Parameters:
- iterable:
Iterable<T>
Returns: T | undefined