Skip to main content

Function: first()

first(this, left): unknown

Return the first item of the input sequence. The input could be array-like or a mapping, but not a string.

Parameters

this: FilterContext

An object containing a reference to the active render context and any keyword/named arguments.

left: unknown

Any value.

Returns

unknown

The first item in the input iterable, or null if the input value is not iterable, or undefined if the iterable is empty.

Defined in

src/builtin/filters/array.ts:68