first<T>
Gets the array’s first element.
Import:
import 'obsidian-test-mocks/setup';Signature:
function first(this: T[]): T | undefinedParameters:
| Parameter | Type | Description |
|---|---|---|
this |
T[] |
Returns: T | undefined — The first element, or undefined when the array is empty.