This is a Stage 3 TC39 proposal that adds the methods findLast and findLastIndex to Array.prototype and the various TypedArray.prototypes. These methods are the "from the end" versions of find and findIndex.

Motivation

Finding an element in an Array is a common operation. However, finding an element from the end of an Array is unergonomic. The current ergonomic solutions like `array.reverse().find` require unnecessary mutation or copying. This proposal adds "from the end" versions of the common `find` and `findIndex` methods: `findLast` and `findLastIndex`.

Specification

Specification link


Specification currently under development in a Working Group

Status in Chromium

Blink>JavaScript>Language


In developer trial (Behind a flag) (tracking bug)

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

  • Positive
  • Positive
  • Positive

Owner

Last updated on 2021-12-01