Skip to content

Array<T>

Unofficial

Augments the built-in Array interface.

Signature:

export interface Array<T>

Methods

Method Returns Description
contains(target) boolean Checks if the array contains a specific element.
findLastIndex(predicate) number Returns the index of the last element that satisfies the provided predicate.
first() T | undefined Returns the first element of the array.
last() T | undefined Returns the last element of the array.
remove(target) void Removes an element from the array, if it exists, otherwise returns the array unchanged.
shuffle() this Shuffles the array in place.
unique() T[] Returns a new array with unique elements.

Links to this page: