Last active
December 14, 2015 16:39
-
-
Save willdages/5116507 to your computer and use it in GitHub Desktop.
Logging objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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