{"ScriptPreparationCode":null,"TestCases":[{"Name":"Destructuring","Code":"var list = [];\r\n\r\nfor (let i = 0; i \u003C 10; \u002B\u002Bi) {\r\n const type = i % 2 === 1 ? \u0027cases\u0027 : \u0027non-case\u0027;\r\n const newObj = {\r\n test: \u0027destructoring vs assigment\u0027,\r\n ...(type === \u0027cases\u0027 \u0026\u0026 {name})\r\n }\r\n list.push(newObj);\r\n}\r\n","IsDeferred":false},{"Name":"Assigment","Code":"var list = [];\r\n\r\nfor (let i = 0; i \u003C 10; \u002B\u002Bi) {\r\n const type = i % 2 === 1 ? \u0027cases\u0027 : \u0027non-case\u0027;\r\n const newObj = {\r\n test: \u0027destructoring vs assigment\u0027,\r\n name: type === \u0027cases\u0027 ? name: undefined,\r\n }\r\n list.push(newObj);\r\n}\r\n\r\n","IsDeferred":false},{"Name":"Assignment (alternative)","Code":"var list = [];\r\n\r\nfor (let i = 0; i \u003C 10; \u002B\u002Bi) {\r\n const type = i % 2 === 1 ? \u0027cases\u0027 : \u0027non-case\u0027;\r\n const newObj = {\r\n test: \u0027destructoring vs assigment\u0027,\r\n }\r\n if (type === \u0027cases\u0027)\r\n newObj.name = name;\r\n list.push(newObj);\r\n}\r\n","IsDeferred":false}]}