You are almost there!
for(var prop in myobject){
alert(prop);
alert(myobject[prop]);
}
Keep in mind that this will only jump to properties that do not have an attribute {DontEnum}. Almost all built-in properties and methods will not be repeated, you will see only custom properties and methods added either directly or through a prototype.
source
share