packages/find/index.js
/**
 * Find the first 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 {*}                   Found element, if any.
 */
Find the first 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 {*}                   Found element, if any.
Find the first 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 { * } Found element if any .
function _find (predicate, list) {
  const index = findIndex(predicate, list)
  if (index >= 0) {
    return list[index]
  }
}
function _find ( predicate , list ) { const index = findIndex ( predicate , list ) if ( index >= 0 ) { return list [ index ] } }
Find the first element in a list that satisfies a predicate function.
Find the first element in a list that satisfies a predicate function .