I think about saving objects using JSON.stringify and later load them again. The “stringification” works well of course, however I am not sure how I would set the prototype/class of an object.
I think about saving objects using JSON.stringify and later load them again. The stringification
Share
You can use
.toJSONand reviver callback to achieve this.Here is the scheme:
in this simplified scheme, the class must be global.