question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `Array.prototype.findLast` and `Array.prototype.findLastIndex`

See original GitHub issue

lib 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:open
  • Created a year ago
  • Reactions:25
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

19reactions
DanielRosenwassercommented, Jun 6, 2022

@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.

6reactions
monikamscommented, Oct 12, 2022

With which version of typescript I could use the method findLast?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found