title: Getting a list of associative array keys
body: <p>I have an associative array in JavaScript:</p>
  <pre><code>var dictionary = {
      &quot;cats&quot;: [1,2,3,4,5],
      &quot;dogs&quot;: [6,7,8,9,10]
  };
  </code></pre>
  <p>How do I get this dictionary's keys? I.e., I want</p>
  <pre><code>var keys = [&quot;cats&quot;, &quot;dogs&quot;];
  </code></pre>
  <hr />
  <p>Just to get the terminology correct - there is no such thing as an 'associative array' in JavaScript - this is technically just an <code>object</code> and it is the object keys we want.</p>