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 currently under development in a Working Group
Status in Chromium
In developer trial (Behind a flag)
(tracking bug)
Consensus & Standardization
- Positive
- Positive
- Positive
Owner
Last updated on 2022-02-14