This might be useful
function showProps(obj, objName) {
var result = "";
for (var i in obj)
result += objName + "." + i + " = " + obj[i] + "\n";
return result;
}
Copied this from https://developer.mozilla.org/en/JavaScript/Guide/Working_with_Objects