title: JavaScript: How to iterate object with two the same keys (and get two values)
body: <pre><code>var obj = { key: value1, key: value2}
  </code></pre>
  
  <p>I would like to iterate it and get pars of (key and value1) and (key and value2)</p>
  
  <p>if I use simple cycle:</p>
  
  <pre><code>for (var i in obj){
   console.log(obj[i])
  }
  </code></pre>
  
  <p>I got:
  key value2
  key value2</p>
  
  <p>so obj[i] always take last key</p>