I am having small problem in my JS where i need to iterate through all the keys in the associative array.
var listOfKeys=new Array();
for (var key in parsedArray)
It works perfectly and returns all the properties associated to the object. Now i have a situation to add the prototype method to an array,
so now the parsedArray is eligible to access this new prototype ModifyKey (actually ModifyKey is a member to all my arrays).
Now when i loop through the parsedArray to find all the keys, it returns all the keys along with the prototypes associated with that...
is there a better way to overcome this..
*I know some workarounds like, having the parsedArray as simplearray which holds the array of key value pairs to get the keys without this problem. But the input array am getting is not in my control, its a json result from the another REST service.*
以上就是problem Getting the keys alone from Associative array ? for (var key in AssociativeArray) returns all the keys and its prototype members..的详细内容，更多请关注web前端其它相关文章！