Skip to content

Instantly share code, notes, and snippets.

@willdages
Last active December 14, 2015 16:39
Show Gist options
  • Save willdages/5116507 to your computer and use it in GitHub Desktop.
Save willdages/5116507 to your computer and use it in GitHub Desktop.
Logging objects
var object = {
"a": 1,
"b": 2,
"c": 3
}
console.log('Look at this awesome object: ' + object);
// Outputs: Look at my awesome object: [object Object] -- totally opaque :(
console.log('Look at this awesome object: %o', object);
// Outputs the object as a twirl-down -- you can explore & see inside :)
// Logging the object by itself has the same result
console.log(object);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment