core3-utils

@wixc3/common on Github

Home > @wixc3/common > prev

prev() function

Find the element before an item

Signature:

export declare function prev<T>(iterable: Nullable<Iterable<T>>, item: T): T | undefined;

Parameters

Parameter Type Description
iterable [Nullable](/core3-utils/common.nullable.html)<Iterable<T>>
item T

Returns:

T | undefined

undefined if item is first or not found