findLast.js 301 B

12345678910111213
  1. var findLastIndex = require('./findLastIndex');
  2. /**
  3. * Returns last item that matches criteria
  4. */
  5. function findLast(arr, iterator, thisObj){
  6. var idx = findLastIndex(arr, iterator, thisObj);
  7. return idx >= 0? arr[idx] : void(0);
  8. }
  9. module.exports = findLast;