When JavaScript handles an object such as json andthe result is output,
[object Object]
maybe displayed.
This is because we are trying to output the data in object format as it is.
This can be solved by converting the number to a string.
//json_object => [object Object] Error Workaround
JSON.stringify(json_object);
and solve it.
I look forward to helping you.
Top comments (2)
To add on, if you would like to pretty print the json object, you can this:
Instead of printing an object like this (as in the original example):
it will print it like this:
Very descriptive description. Thank you.