Skip to content

Tag: node.js

Convert a string to an object and call a function

I want to store an object as a string, and then convert ot back to an object and call a method of this object. Answer If JSON.parse and JSON.stringify would allow a copy of methods, your code would be insecure and would have risks of people running arbitrary code on your server/computer since normally JSON st…