index.js
function indexOfElementInArray(element, array) {
  if (!array) return -1;

  if (array.indexOf) {
    return array.indexOf(element);
  }

  var len = array.length,
    i;

  for (i = 0; i < len; i += 1) {
    if (array[i] === element) {
      return i;
    }
  }

  return -1;
}
function indexOfElementInArray(element, array) {
  if (!array) return -1;

  if (array.indexOf) {
    return array.indexOf(element);
  }

  var len = array.length,
    i;

  for (i = 0; i < len; i += 1) {
    if (array[i] === element) {
      return i;
    }
  }

  return -1;
}
function indexOfElementInArray ( element , array ) { if ( ! array ) return - 1 ; if ( array . indexOf ) { return array . indexOf ( element ) ; } var len = array . length , i ; for ( i = 0 ; i < len ; i += 1 ) { if ( array [ i ] === element ) { return i ; } } return - 1 ; }
need this for old browsers. Should this be a separate module?
need this for old browsers . Should this be a separate module?