packages/find-last-index/index.js
/**
 * Find the index of the last element in a list that satisfies a predicate function.
 *
 * @param  {Function} predicate  Function that determines whether to pick the item.
 * @param  {Array}    list       List of items to find.
 * @return {Number}              Found element index, or -1 if not found.
 */
Find the index of the last element in a list that satisfies a predicate function.
@param  {Function} predicate  Function that determines whether to pick the item.
@param  {Array}    list       List of items to find.
@return {Number}              Found element index, or -1 if not found.
Find the index of the last element in a list that satisfies a predicate function . @param { Function } predicate Function that determines whether to pick the item . @param { Array } list List of items to find . @return { Number } Found element index or - 1 if not found .
function _findLastIndex (predicate, list) {
  for (let i = list.length - 1; i >= 0; i--) {
    if (predicate(list[i], i, list)) {
      return i
    }
  }
  return -1
}
function _findLastIndex ( predicate , list ) { for ( let i = list . length - 1 ; i >= 0 ; i -- ) { if ( predicate ( list [ i ] , i , list ) ) { return i } } return - 1 }
Find the index of the last element in a list that satisfies a predicate function.
Find the index of the last element in a list that satisfies a predicate function .