{"ScriptPreparationCode":null,"TestCases":[{"Name":"Using the spread operator","Code":"const firstObject = { sampleData: \u0027Hello world\u0027 }\r\nconst secondObject = { moreData: \u0027foo bar\u0027 }\r\nconst finalObject = {\r\n\t...firstObject,\r\n \t...secondObject\r\n};","IsDeferred":false},{"Name":"Using Object.assign","Code":"const firstObject = { sampleData: \u0027Hello world\u0027 }\r\nconst secondObject = { moreData: \u0027foo bar\u0027 }\r\nconst finalObject = Object.assign({}, firstObject, secondObject);","IsDeferred":false},{"Name":"Using For-In loop","Code":"const firstObject = { sampleData: \u0027Hello world\u0027 }\r\nconst secondObject = { moreData: \u0027foo bar\u0027 }\r\nconst finalObject = {}\r\nfor (let key in firstObject) {\r\n finalObject[key] = firstObject[key];\r\n}\r\nfor (let key in secondObject) {\r\n finalObject[key] = secondObject[key];\r\n}","IsDeferred":false},{"Name":"Using For-In loop with hasOwnProperty","Code":"const firstObject = { sampleData: \u0027Hello world\u0027 }\r\nconst secondObject = { moreData: \u0027foo bar\u0027 }\r\nconst finalObject = {}\r\nfor (let key in firstObject) {\r\n if (Object.prototype.hasOwnProperty.call(firstObject, key)) {\r\n finalObject[key] = firstObject[key];\r\n }\r\n}\r\nfor (let key in secondObject) {\r\n if (Object.prototype.hasOwnProperty.call(secondObject, key)) {\r\n finalObject[key] = secondObject[key];\r\n }\r\n}","IsDeferred":false}]}