title: How to iterate over the keys and values in an object in CoffeeScript?
body: <p>I have an object (an "associate array" so to say - also known as a plain JavaScript object):</p>
  
  <pre><code>obj = {}
  obj["Foo"] = "Bar"
  obj["bar"] = "Foo"
  </code></pre>
  
  <p>I want to iterate over <code>obj</code> using CoffeeScript as follows:</p>
  
  <pre><code># CS
  for elem in obj
  </code></pre>
  
  <p>bu the CS code above compiles to JS:</p>
  
  <pre><code>// JS
  for (i = 0, len = obj.length; i &lt; len; i++)
  </code></pre>
  
  <p>which isn't appropriate in this case.</p>
  
  <hr>
  
  <p>The JavaScript way would be <code>for(var key in obj)</code> but now I'm wondering: <strong>how can I do this in CoffeeScript?</strong></p>