Skip to content

Array<T>

Unofficial

Augments the built-in Array interface.

Signature:

export interface Array<T>

Methods

MethodReturnsDescription
contains(target)booleanChecks if the array contains a specific element.
findLastIndex(predicate)numberReturns the index of the last element that satisfies the provided predicate.
first()T | undefinedReturns the first element of the array.
last()T | undefinedReturns the last element of the array.
remove(target)voidRemoves an element from the array, if it exists, otherwise returns the array unchanged.
shuffle()thisShuffles the array in place.
unique()T[]Returns a new array with unique elements.

Links to this page: