Skip to content

first<T>

Gets the array’s first element.

Import:

import 'obsidian-test-mocks/setup';

Signature:

function first(this: T[]): T | undefined

Parameters:

Parameter Type Description
this T[]

Returns: T | undefined — The first element, or undefined when the array is empty.