lib/compiler/tokens.js
function first(arr, fn) {
  const l = arr.length;
  for (let i = 0; i < l; i += 1) {
    const res = fn(arr[i], i);
    if (res) {
      return res;
    }
  }

  return null;
}
function first(arr, fn) {
  const l = arr.length;
  for (let i = 0; i < l; i += 1) {
    const res = fn(arr[i], i);
    if (res) {
      return res;
    }
  }

  return null;
}
function first ( arr , fn ) { const l = arr . length ; for ( let i = 0 ; i < l ; i += 1 ) { const res = fn ( arr [ i ] , i ) ; if ( res ) { return res ; } } return null ; }
Get the first truthy value returned by a mapper function
@param {any[]} arr
@param {function} fn
Get the first truthy value returned by a mapper function