Add `Array.prototype.findLast` and `Array.prototype.findLastIndex`
See original GitHub issuelib Update Request
Configuration Check
My compilation target is ES5
and my lib is ESNext
.
Missing / Incorrect Definition
Missing Array.prototype.findLast
and Array.prototype.findLastIndex
Sample Code
[3, 2, 1].findLast(x => x > 2);
Documentation Link
Proposal: https://tc39.es/proposal-array-find-from-last/ (currently stage 3 4)
Can I Use: https://caniuse.com/mdn-javascript_builtins_array_findlast (Chrome and Safari already shipped it without flags)
Issue Analytics
- State:
- Created a year ago
- Reactions:25
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Array.prototype.findLastIndex() - JavaScript - MDN Web Docs
Array.prototype.findLastIndex(). The findLastIndex() method iterates the array in reverse order and returns the index of the first element ...
Read more >Array and TypedArray findLast and findLastIndex
This is a Stage 3 TC39 proposal that adds the methods findLast and findLastIndex to Array.prototype and the various TypedArray.prototypes.
Read more >array.prototype.findlastindex - npm
An ESnext spec-compliant `Array.prototype.findLastIndex` shim/polyfill/replacement that works as far down as ES3.. Latest version: 1.2.1, ...
Read more >New in JavaScript: Array.findLast and Array.findLastIndex
Finding values in Arrays is a common practice via find and findIndex . These methods iterate from the array beginning, though. const things...
Read more >227939 – Implement Array.prototype.findLast and Array ...
... Implement Array.prototype.findLast and Array.prototype.findLastIndex ... Show Obsolete (3) View All Add an attachment (proposed patch, testcase, etc.) ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@fatcerberus, the context is that @Kingwl is contributing the changeset to Firefox.
By the way, we reached Stage 4 today! 🎉🎉🎉
I believe that means we should add this to
lib.es2023.array.d.ts
.With which version of typescript I could use the method findLast?