Skip to content

Instantly share code, notes, and snippets.

@DirkyJerky
Created May 10, 2014 18:54
Show Gist options
  • Save DirkyJerky/a29bba43e5a559a23b19 to your computer and use it in GitHub Desktop.
Save DirkyJerky/a29bba43e5a559a23b19 to your computer and use it in GitHub Desktop.
List the properties of a javascript object
var depth = 1;
var br = '<br />';
var target = document;
$.each(Object.keys(target), function(K1, V1) {
document.write('"' + V1 + '" : "' + target[V1] + '" [' + (typeof target[V1]) + ']' + br);
/*
if(((typeof target[V1]) == 'object') && target != target[V1]) {
var target2 = target[V1];
$.each(Object.keys(target2), function(K2, V2) {
console.log(K1 + '.' + K2 + ': "' + V2 + '" -> "' + target2[V2] + '"');
});
}
*/
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment