{"ScriptPreparationCode":"var voucher = {\r\n \u0022single\u0022: false,\r\n \u0022applyOverTaxes\u0022: false,\r\n \u0022discountType\u0022: \u00221\u0022,\r\n \u0022value\u0022: 100,\r\n \u0022minimumAmount\u0022: 0,\r\n \u0022quantity\u0022: 1,\r\n \u0022suffixLength\u0022: 8,\r\n \u0022code\u0022: \u0022IF5R0AFX\u0022,\r\n \u0022vertical\u0022: [],\r\n \u0022allowedPaymentMethods\u0022: [],\r\n \u0022allowedBanks\u0022: [],\r\n \u0022types\u0022: [],\r\n \u0022partners\u0022: [],\r\n \u0022startDate\u0022: \u00222020-10-21T00:00:00.000Z\u0022,\r\n \u0022endDate\u0022: \u00222020-10-21T00:00:00.000Z\u0022,\r\n \u0022applyed\u0022: false\r\n}\r\n\r\nvar voucherQuantityAndPriceUpdated = {\r\n value: 120,\r\n quantity: 10\r\n}","TestCases":[{"Name":"Using Object keys and modifying the original object","Code":"const keysOfObjectWithUpdatedData = Object.keys(voucherQuantityAndPriceUpdated)\r\n\r\nfor (key of keysOfObjectWithUpdatedData) {\r\n\tconst updatedPropertyValue = \r\n\tvoucher[key] = voucherQuantityAndPriceUpdated[key]\r\n}","IsDeferred":false},{"Name":"Using spread to merge objects","Code":"const voucherUpdated = {\r\n\t...voucher,\r\n\t...voucherQuantityAndPriceUpdated\r\n}","IsDeferred":false},{"Name":"Manually editing every single property (Wanna have this to prove why sometimes there is a manual assign for each property required)","Code":"voucher.value = voucherQuantityAndPriceUpdated.value\r\nvoucher.quantity = voucherQuantityAndPriceUpdated.quantity","IsDeferred":false}]}