{"ScriptPreparationCode":"var obj = {a: \u0022hello\u0022, c: \u0022test\u0022, po: 33, x: {y: 5677}, arr: [1, 2, 3, 4], anotherObj: {a: 33, str: \u0022whazzup\u0022}};\r\n\r\nvar myCopy = null;","TestCases":[{"Name":"JSON Stringfy","Code":"myCopy = JSON.parse(JSON.stringify(obj));","IsDeferred":false},{"Name":"Lodash cloneDeep","Code":"myCopy = _.cloneDeep(obj);","IsDeferred":false},{"Name":"Ramda Copy","Code":"myCopy = R.clone(obj);","IsDeferred":false},{"Name":"Recursive Copy","Code":"var deepCopy = function(obj) {\r\n var out = Array.isArray(obj) ? [] : {};\r\n \r\n for (var key in obj) {\r\n var v = obj[key];\r\n out[key] = (typeof v === \u0027object\u0027) ? deepCopy(v) : v;\r\n }\r\n return out;\r\n};\r\n\r\nmyCopy = deepCopy(obj);","IsDeferred":false},{"Name":"Recursive Copy Distinct","Code":"var deepCopy = function(block) {\r\n var out = null;\r\n \r\n if (Array.isArray(block)) {\r\n out = [];\r\n for (var index = 0; index \u003C block.length; \u002B\u002Bindex) {\r\n var subArray = block[index];\r\n out.push((typeof subArray === \u0027object\u0027) ? deepCopy(subArray) : subArray);\r\n }\r\n } else {\r\n out = {};\r\n for (var key in block) {\r\n var subObject = block[key];\r\n out[key] = (typeof subObject === \u0027object\u0027) ? deepCopy(subObject) : subObject;\r\n }\r\n }\r\n return out;\r\n};\r\n\r\nmyCopy = deepCopy(obj);","IsDeferred":false}]}