When debugging using console.log()
, how can I get the full object?
const myObject = {
\"a\":\"a\",
\"b\":{
\"c\":\"c\",
\"d\":
I think this could be useful for you.
const myObject = {
"a":"a",
"b":{
"c":"c",
"d":{
"e":"e",
"f":{
"g":"g",
"h":{
"i":"i"
}
}
}
}
};
console.log(JSON.stringify(myObject, null, '\t'));
As mentioned in this answer:
JSON.stringify
's third parameter defines white-space insertion for pretty-printing. It can be a string or a number (number of spaces).