Search e01
One query across the encyclopedia, books, dictionary, papers, Wikidata and the developer library. Every hit carries its source.
7 results across 6 corpora for Array.prototype.findLastIndex().
Encyclopedia 1
ECMAScript version history
– ECMAScript 2023 === The 14th edition, ECMAScript 2023, was published in June 2023. This version introduces the toSorted , toReversed , with , findLast , and findLastIndex methods on Array.prototype and TypedArray.prototype , as well as the toSpliced method on Array.prototype ; added support for #! shebang comments at the beginning of files to better facilitate executable ECMAScript files; and allowed the use of mo
Developer library 6
Firefox 104 release notes for developers
nges for web developers ### HTML No notable changes. ### CSS No notable changes. ### JavaScript - The methods Array.prototype.findLast(), Array.prototype.findLastIndex(), TypedArray.prototype.findLast(), and TypedArray.prototype.findLastIndex() are now supported. These are used to find the value and index (respectively) of the last element in an Array or TypedArray that matches a supplied test function. (Se
Array
hey contain `undefined`. Methods that conflate empty slots with `undefined` elements include the following: entries(), fill(), find(), findIndex(), findLast(), findLastIndex(), includes(), join(), keys(), toLocaleString(), toReversed(), toSorted(), toSpliced(), values(), and with(). ```js const colors = ["red", "yellow", "blue"]; colors[5] = "purple"; const iterator = colors.keys(); for (const key of iterator) { c
Array.prototype.findLast()
ion, undefined is returned. If you need to find: - the _first_ element that matches, use find(). - the _index_ of the last matching element in the array, use findLastIndex(). - the _index of a value_, use indexOf(). (It's similar to findIndex(), but checks each element for equality with the value instead of using a testing function.) - whether a value _exists_ in an array, use includes(). Again, it checks each
Array.prototype.indexOf()
/array.prototype.indexof) - [Indexed collections](/docs/Web/JavaScript/Guide/Indexed_collections) guide - Array - Array.prototype.findIndex() - Array.prototype.findLastIndex() - Array.prototype.lastIndexOf() - TypedArray.prototype.indexOf() - String.prototype.indexOf()
Array.prototype.findIndex()
) - [Indexed collections](/docs/Web/JavaScript/Guide/Indexed_collections) guide - Array - Array.prototype.find() - Array.prototype.findLast() - Array.prototype.findLastIndex() - Array.prototype.indexOf() - Array.prototype.lastIndexOf() - TypedArray.prototype.findIndex()
Array.prototype.findLastIndex()
The **`findLastIndex()`** method of Array instances iterates the array in reverse order and returns the index of the first element that satisfies the provided testing function. If no elements satisfy the testing function, -1 is returned. See also the findLast() method, which returns the value of last element that satisfies the testing function (rather than its index). shorter ```js interactive-example const array