title: Javascript: what lookup is faster: array.indexOf vs object hash?
body: <p>I have to perform a <em>LOT</em> of lookups, while parsing xmlStream if i need some tag or not.</p>
  
  <p>I can do it with array.indexOf method (i have about ~15 items in array) or using object[key] lookup.</p>
  
  <p>Second solution seems more efficient in theory for me, but does not look line nice in my code. But if it is really more efficient, i would leave it as it is.</p>
  
  <p>E.g.:</p>
  
  <pre><code>var tags = [
      'tag1',
      'tag2',
      'tag3',
      ...
  ];
  
  var tags2 = {
      'tag1' : null,
      'tag2' : null,
      'tag3' : null,
  }
  
  tags.indexOf(value) // exists?
  tags2[value] // exists?
  </code></pre>