{"ScriptPreparationCode":"var MyObject = {\r\n description: \u0027Creates a deep copy of source, which should be an object or an array.\u0027,\r\n myNumber: 123456789,\r\n myBoolean: true,\r\n jayson: {\r\n stringify: \u0027JSON.stringify() method converts a JavaScript value to a JSON string....\u0027,\r\n parse: \u0027JSON.parse() method parses a JSON string...\u0027\r\n }\r\n};\r\n\r\nvar myCopy = null;\r\n","TestCases":[{"Name":"Lodash cloneDeep","Code":"myCopy = _.cloneDeep(MyObject);","IsDeferred":false},{"Name":"Json clone","Code":"myCopy = JSON.parse(JSON.stringify(MyObject));","IsDeferred":false},{"Name":"Ramda clone","Code":"myCopy = R.clone(MyObject);","IsDeferred":false},{"Name":"hand rolled","Code":"const cp=(obj)=\u003E\u0022object\u0022 === typeof obj ? Object.fromEntries(Object.entries(obj).map(([k,v])=\u003E[k,cp(v)])) : obj\r\n\r\nmyCopy = cp(MyObject)","IsDeferred":false},{"Name":"spread","Code":"myCopy = {...MyObject}","IsDeferred":false},{"Name":"obj.assign","Code":"myCopy = Object.assign({}, MyObject)","IsDeferred":false},{"Name":"structuredClone","Code":"myCopy = structuredClone(MyObject)","IsDeferred":false}]}