var myObject = { name: "Cody", status: "Surprised" };
for (var propertyName in myObject) {
document.writeln(propertyName+" : "+myObject[propertyName]);
}
Source:
http://stackoverflow.com/questions/85992/how-do-i-enumerate-the-properties-of-a-javascript-object
No comments:
Post a Comment