src/helpers.js
function index(a, fn) {
  let i, l;
  for (i = 0, l = a.length; i < l; i++) {
    if (fn(a[i]))
      return i;
  }
  return -1;
}
function index(a, fn) {
  let i, l;
  for (i = 0, l = a.length; i < l; i++) {
    if (fn(a[i]))
      return i;
  }
  return -1;
}
function index ( a , fn ) { let i , l ; for ( i = 0 , l = a . length ; i < l ; i ++ ) { if ( fn ( a [ i ] ) ) return i ; } return - 1 ; }
Function returning the index of the first element of a list matching the
given predicate.

@param  {array}     a  - The target array.
@param  {function}  fn - The predicate function.
@return {mixed}        - The index of the first matching item or -1.
Function returning the index of the first element of a list matching the given predicate .