Skip to content

array.Function.first

soetas edited this page Nov 30, 2024 · 2 revisions

estdlib v0.1.2 / array / first

Function: first()

first(array): unknown

Gets the first element of array

Parameters

array: unknown[]

The array to query

Returns

unknown

  • Returns the first element of array

Since

0.1.2

See

source

Example

first([1, 2, 3])
// => 1

first([])
// => undefined
Clone this wiki locally