Skip to content

Instantly share code, notes, and snippets.

@animeoakes
Last active May 22, 2017 14:14
Show Gist options
  • Save animeoakes/72d0da365bfe4acfb494 to your computer and use it in GitHub Desktop.
Save animeoakes/72d0da365bfe4acfb494 to your computer and use it in GitHub Desktop.
console.log an object without fully displaying nested objects
function shallow_log(name, object) {
console.log(typeof(object))
let tab = ' '
console.log(name + ' {')
for (let property in object) {
let value = object[property]
if (_.isObject(value)) {
value = value.toString()
}
console.log(tab + property + ': ' + value + ',')
}
console.log('}')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment