Possible Duplicate:
Pick random property from a Javascript object
suppose I have a javascript object:
Config.UI.Area = {
"uuid": {
"_type": "string"
},
"frame": {
"_type": "rect"
},
"zIndex": {
"_type": "string"
}
}
then I want get each of the property's name,like "uuid","frame","zIndex" by using for loop:
var prop=config.ui.area;
var arr=new Array()
for(var i in prop){
//do something with prop[i]?
//arr.push(prop[i].....)?
}
I can not directly use prop[i],it would return me an object,how can I just get it's name?