{"ScriptPreparationCode":null,"TestCases":[{"Name":"Using the spread operator","Code":"\u0022use strict\u0022;\r\n\r\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\r\n\r\nfunction _objectSpread(target) { for (var i = 1; i \u003C arguments.length; i\u002B\u002B) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\r\n\r\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\r\n\r\nvar firstObject = {\r\n sampleData: \u0027Hello world\u0027\r\n};\r\nvar secondObject = {\r\n moreData: \u0027foo bar\u0027\r\n};\r\n\r\nvar finalObject = _objectSpread(_objectSpread({}, firstObject), secondObject);","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}]}