🔰converting objects
Last updated
Last updated
convert an object to other forms.
about .toJSON()
Object.prototype does not define.toJSON()
.
JSON.stringify() looks for .toJSON()
on any object it is asked to serialize.
if it exists, it is invoked, and the return value is serialized, instead of the original object.