MCPcopy
hub / github.com/mongodb/node-mongodb-native / findLast

Function findLast

test/tools/utils.ts:571–578  ·  view source on GitHub ↗
(
  array: unknown[],
  predicate: (value: unknown, index: number, array: unknown[]) => boolean,
  thisArg?: any
)

Source from the content-addressed store, hash-verified

569 thisArg?: any
570): T | undefined;
571export function findLast(
572 array: unknown[],
573 predicate: (value: unknown, index: number, array: unknown[]) => boolean,
574 thisArg?: any
575): unknown | undefined {
576 if (typeof array.findLast === 'function') return array.findLast(predicate, thisArg);
577 return array.slice().reverse().find(predicate, thisArg);
578}
579
580// Node.js 16 doesn't make this global, but it can still be obtained.
581export const DOMException: {

Callers 2

testFunction · 0.90

Calls 1

findMethod · 0.45

Tested by 1

testFunction · 0.72