{"ScriptPreparationCode":"function forEach(array, iteratee) {\r\n let index = -1;\r\n const length = array.length;\r\n while (\u002B\u002Bindex \u003C length) {\r\n iteratee(array[index], index);\r\n }\r\n return array;\r\n}\r\n\r\nfunction clone(target, map = new WeakMap()) {\r\n if (typeof target === \u0027object\u0027) {\r\n const isArray = Array.isArray(target);\r\n let cloneTarget = isArray ? [] : {};\r\n\r\n if (map.get(target)) {\r\n return map.get(target);\r\n }\r\n map.set(target, cloneTarget);\r\n\r\n if (isArray) {\r\n forEach(target, (value, index) =\u003E {\r\n cloneTarget[index] = value;\r\n })\r\n } else {\r\n forEach(Object.keys(target), (key, index) =\u003E {\r\n cloneTarget[key] = target[key];\r\n })\r\n }\r\n return cloneTarget;\r\n } else {\r\n return target;\r\n }\r\n}\r\n\r\nvar 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":"Bitfish Simple Clone","Code":"myCopy = clone(MyObject)","IsDeferred":false}]}