Possible duplicate:
Loop through a JavaScript object
Get an array of object keys
Is there any way to use hashmaps in javascript. I found this page that shows one way to have hashmaps in javascript. Based on this, I save the data as shown below:
var map = new Object(); map[myKey1] = myObj1; map[myKey2] = myObj2; function get(k) { return map[k]; }
But I want the keySet (all keys) of the map object in the same way as it is done in Java ( map.keySet(); ).
Can someone show me how to get all the keys present in this object?
Darkknightfan
source share