`Array.prototype.findLast` and `Array.prototype.findLastIndex` just advanced to TC39 stage 3 Proposal: <https://github.com/tc39/proposal-array-find-from-last> Spec: <https://tc39.es/proposal-array-find-from-last/index.html> ``` const array = [{ value: 1 }, { value: 2 }, { value: 3 }, { value: 4 }]; array.find(n => n.value % 2 === 1); // { value: 1 } array.findIndex(n => n.value % 2 === 1); // 0 array.findLast(n => n.value % 2 === 1); // { value: 3 } array.findLastIndex(n => n.value % 2 === 1); // 2 ```
Created attachment 433476 [details] [Patch] WIP
Comment on attachment 433476 [details] [Patch] WIP View in context: https://bugs.webkit.org/attachment.cgi?id=433476&action=review r=me > Source/JavaScriptCore/builtins/ArrayPrototype.js:269 > + var kValue = array[i]; I like the name like `element` instead of `kValue` even though it is derived from the spec's name since the name is not suitable for WebKit's coding style.
Comment on attachment 433476 [details] [Patch] WIP Can you add tests in JSTests/stress?
Created attachment 433521 [details] Patch
Created attachment 433528 [details] Patch
Created attachment 433547 [details] Patch
Committed r279937 (239681@main): <https://commits.webkit.org/239681@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 433547 [details].
<rdar://problem/80610784>