MCPcopy Create free account
hub / github.com/nodejs/node / findLast

Function findLast

test/fixtures/snapshot/typescript.js:513–521  ·  view source on GitHub ↗
(array, predicate)

Source from the content-addressed store, hash-verified

511 }
512 ts.find = find;
513 function findLast(array, predicate) {
514 for (var i = array.length - 1; i >= 0; i--) {
515 var value = array[i];
516 if (predicate(value, i)) {
517 return value;
518 }
519 }
520 return undefined;
521 }
522 ts.findLast = findLast;
523 /** Works like Array.prototype.findIndex, returning `-1` if no element satisfying the predicate is found. */
524 function findIndex(array, predicate, startIndex) {

Callers

nothing calls this directly

Calls 1

predicateFunction · 0.50

Tested by

no test coverage detected