Skip to content

Instantly share code, notes, and snippets.

@okor
Created December 29, 2011 23:22
Show Gist options
  • Save okor/1536669 to your computer and use it in GitHub Desktop.
Save okor/1536669 to your computer and use it in GitHub Desktop.
Print all attributes and values in a Javascript Object
function printObject(o) {
var out = '';
for (var p in o) {
out += '\n' + ':: ' + p + '(' + typeof(o[p]) + ') ::' + '\n' + o[p] + '\n';
}
console.log(out);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment