Skip to content

last<T>

Gets the array’s last element.

Import:

import 'obsidian-test-mocks/setup';

Signature:

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

Parameters:

Parameter Type Description
this T[]

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