title: What is a Hash in javascript? How can i use a hash for an array?
body: <p>I'm using an array in my object prototype which basically has add, remove, search functions attached to it.</p>
  
  <p>Something like this</p>
  
  <pre><code>myobj = function() {
    this.Array_ = [];
  }
  
  myobj.prototype.add = function(item) {
    goog.array.insert(this.Array_, item);
  }
  
  myobj.prototype.hasItem = function(item) {
    goog.array.contains(this.Array_, item);
  }
  </code></pre>
  
  <p>And a sample Array in my case would list of integers. [1, 2, 3, 4]</p>
  
  <p>But later I learnt that this is very costly and can be cost saving if I use hash.
  Can someone explain use of hash  with the above example.</p>