Sha256: 67e2d0a83bae786a8366d53c82307322ac8a7fabe7edb28f1dbb277281519a81
Contents?: true
Size: 517 Bytes
Versions: 7
Compression:
Stored size: 517 Bytes
Contents
var makeIterator = require('../function/makeIterator_'); /** * Returns the index of the last item that matches criteria */ function findLastIndex(arr, iterator, thisObj){ iterator = makeIterator(iterator, thisObj); if (arr == null) { return -1; } var n = arr.length; while (n-- >= 0) { if (iterator(arr[n], n, arr)) { return n; } } return -1; } module.exports = findLastIndex;
Version data entries
7 entries across 7 versions & 1 rubygems