{"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 functioada:function(){alert(\u0022testtt\u0022)}\r\n};\r\n\r\nvar myCopy = null;\r\n\r\n function deepCopy(object) {\r\n // if not array or object or is null return self\r\n if (typeof object !== \u0027object\u0027 || object == null) {\r\n return object;\r\n }\r\n var newObject;\r\n // handle case: array\r\n if (object instanceof Array) {\r\n newObject = [];\r\n for (var index = 0, length = object.length; index \u003C length; index\u002B\u002B) {\r\n newObject[index] = deepCopy(object[index]);\r\n }\r\n return newObject;\r\n }\r\n // handle case: object\r\n newObject = {};\r\n for (var property in object) {\r\n if (object.hasOwnProperty(property)) {\r\n newObject[property] = deepCopy(object[property]);\r\n }\r\n }\r\n return newObject;\r\n }\r\n function infoDeepCopyWithNullCheck(copyItem) {\r\n if ($.isPlainObject(copyItem)) {\r\n return $.extend(true, {}, copyItem);\r\n }\r\n return _.cloneDeep(copyItem);\r\n }","TestCases":[{"Name":"lodash","Code":"myCopy = _.cloneDeep(MyObject);","IsDeferred":false},{"Name":"Json string","Code":"myCopy = JSON.parse(JSON.stringify(MyObject));","IsDeferred":false},{"Name":"deepCopy","Code":"myCopy = deepCopy(MyObject);","IsDeferred":false},{"Name":"angular Copy","Code":"myCopy = angular.copy(MyObject);","IsDeferred":false},{"Name":"infoDeepCopyWithNullCheck","Code":"myCopy = infoDeepCopyWithNullCheck(MyObject);","IsDeferred":false}]}