Skip to content

Instantly share code, notes, and snippets.

@shiv19
Created March 19, 2018 16:42
Show Gist options
  • Save shiv19/51addbddfffd1f16a2e215d5edb43161 to your computer and use it in GitHub Desktop.
Save shiv19/51addbddfffd1f16a2e215d5edb43161 to your computer and use it in GitHub Desktop.
remove cyclic dependency and log the object
console.log = (function(log, inspect) {
return function() {
return log.apply(
this,
Array.prototype.map.call(arguments, function(arg) {
return inspect(arg, {
depth: 2
showHidden: true
}).replace(/\\n/g, '\n')
})
)
}
})(console.log, inspect)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment