Skip to content

Welshman Docs / @welshman/lib / first

Function: first() ​

first<T>(xs, ...args): T

Defined in: packages/lib/src/Tools.ts:32

Returns the first element of an array

Type Parameters ​

• T

Parameters ​

xs ​

T[]

The array

args ​

...unknown[]

Returns ​

T

First element or undefined