{"ScriptPreparationCode":null,"TestCases":[{"Name":"lodash merge","Code":"var a = { a: \u0027oh\u0027, b: \u0027my\u0027 };\r\nvar b = { c: \u0027goddess\u0027 };\r\nvar c = _.merge(a, b);","IsDeferred":false},{"Name":"object.assign","Code":"var a = { a: \u0027oh\u0027, b: \u0027my\u0027 };\r\nvar b = { c: \u0027goddess\u0027 };\r\nvar c = Object.assign(a, b);","IsDeferred":false},{"Name":"spread","Code":"var a = { a: \u0027oh\u0027, b: \u0027my\u0027 };\r\nvar b = { c: \u0027goddess\u0027 };\r\nvar c = { ...a, ...b };","IsDeferred":false},{"Name":"lodash assign","Code":"var a = { a: \u0027oh\u0027, b: \u0027my\u0027 };\r\nvar b = { c: \u0027goddess\u0027 };\r\nvar c = _.assign(a, b);","IsDeferred":false},{"Name":"Good old for loop","Code":"var a = { a: \u0027oh\u0027, b: \u0027my\u0027 };\r\nvar b = { c: \u0027goddess\u0027 };\r\nconst merge = (objA, objB) =\u003E {\r\n const newObject = {};\r\n for (const key in objA) {\r\n if (Object.prototype.hasOwnProperty.call(objA, key)) {\r\n newObject[key] = objA[key];\r\n }\r\n }\r\n // eslint-disable-next-line no-restricted-syntax\r\n for (const key in objB) {\r\n if (Object.prototype.hasOwnProperty.call(objB, key)) {\r\n newObject[key] = objB[key];\r\n }\r\n }\r\n return newObject;\r\n};","IsDeferred":false}]}