I cannot find the JavaScript equivalent of PHP array_keys()
/ array_values()
.
For people unfamiliar with PHP given the following JavaScript hash:
var myHash = {"apples": 3, "oranges": 4, "bananas": 42}
How can I get an array of keys, i.e.,
["apples", "oranges", "bananas"]
The same question with the values, i.e.,
[3, 4, 42]
jQuery can be used.