I want to view a JSON object in the console log to see which attributes are missing or have incorrect values. When I try to simply:
console.log("my object: ", theObject);
I get the output:
theObject {id: "the id", name: "the name", type: "the type", ...}
with the tooltip of the blue "i" saying:
Value below was evaluated just now.
The JSON object that I have created, however, has more attributes than just 'id', 'name', and 'type'. For example, I want to view the 'label' attribute, but when I click the down arrow to view the rest of my attributes, nothing happens.
I have found that I can display the entire object by using
console.log("my object", JSON.stringify(theObject));
but that doesn't help me too much as the object is huge and nested, and I need to be able to see things with the color formatting since the project I'm working on prints out hundreds of objects at a time.
I have similarly tried
console.log("my object", ...{theObject});
because I thought I was printing out the pointer to the object rather than the object itself, and that at some point the actual object was being destroyed. This did not work. Please let me know if you know of a solution, and please provide constructive (and kind!) criticism to about this post as it is my first one.