I was wondering how can I create a JSON (JS) object and then clone it.
This is what I do and it works like a charm
if (typeof JSON.clone !== "function") { JSON.clone = function(obj) { return JSON.parse(JSON.stringify(obj)); }; }
2.1m questions
2.1m answers
60 comments
56.9k users