The JSON.stringify() method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified.
JSON.stringify(value)
JSON.stringify(value, replacer)
JSON.stringify(value, replacer, space)A JSON string representing the given value, or undefined.
Minecraft has modified JSON.stringify function so that when stringify a native object, it always return {}.
A workaround is to deep copy the JSON object. Highly recommend using this package to display native objects in string.
Resources are obtained from here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify