title: IndexOf doesn't work correctly with object which contain array
body: <p>I have a the next code:</p>
  
  <pre><code>function insertIfNotThere(array, item) {
      /* Push the new element everytime: because return -1 */
      if (array.indexOf(item) === -1) {
          array.push(item);
      }
      /*But this log shows 1, 2, 3 and so on...*/
      console.log(array.length);
  
  }
  
  function EventManager(target) {
      var target = target || window, events = {};
      this.observe = function(eventName, cb) {
          if (events[eventName]){
             /* This insert the new event everytime: indexOf doesn't work... */
             insertIfNotThere(events[eventName], cb);
          }else{
             events[eventName] = []; events[eventName].push(cb);
          }
          return target;
      };
  
      this.fire = function(eventName) {
          if (!events[eventName]) return false;
          for (var i = 0; i &lt; events[eventName].length; i++) {
          events[eventName][i].apply(target, Array.prototype.slice.call(arguments, 1));
          }
      };
  }
  </code></pre>
  
  <p>I use "insertIfNotThere" method for checking if the element with the content indicated exist. But... It push the element ever... I don't know what's happening...</p>
  
  <p>I created the event with a button: if I click several times in this, duplicate the elements...</p>