code: function inArray(array, search)
  {
      if(!isArray(array))
      {
          throw 'expected an array as first param';
      }
  
      if(array.indexOf)
      {
          return array.indexOf(search);
      }
  
      for(var i = 0, end = array.length; i < end; i++)
      {
          if(array[i] === search)
          {
              return i;
          }
      }
      return -1;
  }
docs: simplified version of Array.indexOf polyfill