Last active
August 27, 2020 12:25
-
-
Save mweibel/29704ce506a847bae7298d3744c62c3a to your computer and use it in GitHub Desktop.
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
// dbgObject is useful when you have no access to console.log, to debug (e.g. using alert()) a built-in object. | |
function dbgObject(obj) { | |
if (Array.isArray(obj)) { | |
return obj | |
} | |
if (typeof obj !== "object") { | |
return obj | |
} | |
const dbg = {} | |
for (var k in obj) { | |
dbg[k] = dbgObject(obj[k]) | |
} | |
return dbg | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment