index.js
function get(arr, filter, defaultValue) {
  let result;
  arr.forEach((tmp) => {
    if (tmp && filter(tmp)) {
      result = tmp;
    }
  });
  return result || defaultValue;
}
function get(arr, filter, defaultValue) {
  let result;
  arr.forEach((tmp) => {
    if (tmp && filter(tmp)) {
      result = tmp;
    }
  });
  return result || defaultValue;
}
function get ( arr , filter , defaultValue ) { let result ; arr . forEach ( ( tmp ) => { if ( tmp && filter ( tmp ) ) { result = tmp ; } } ) ; return result || defaultValue ; }
Get the value from array by filter
@param {Array} arr The array to filter
@param {Function} filter The filter function
@param {any} defaultValue The default value for no value is valid
@returns {any} The value of filter
Get the value from array by filter