code: 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;
  }
docs: need this for old browsers. Should this be a separate module?