<p>I know in JavaScript, <em>objects</em> double as hashes, but I have been unable to find a built-in function to get the keys:</p>
<pre><code>var h = {a:'b', c:'d'};
</code></pre>
<p>I want something like</p>
<pre><code>var k = h.keys() ; // k = ['a', 'c'];
</code></pre>
<p>It is simple to write a function myself to iterate over the items and add the keys to an array that I return, but is there a standard cleaner way to do that?</p>
<p>I keep feeling it must be a simple built in function that I missed but I can't find it!</p>

This is the best you can do, as far as I know...
```
```
var keys = [];
for (var k in h)keys.push(k);
```
```