{"ScriptPreparationCode":"var queue = [];\r\n\r\nfor (let i = 0; i \u003C 500; i\u002B\u002B) {\r\n const obj = {\r\n id: i \u002B 1,\r\n name: \u0027John Doe\u0027,\r\n age: Math.floor(Math.random() * 50) \u002B 20,\r\n };\r\n\r\n // Add random keys with random values\r\n obj[\u0060key${Math.floor(Math.random() * 50)}\u0060] = Math.random() * 100;\r\n obj[\u0060key${Math.floor(Math.random() * 50)}\u0060] = Math.random() * 100;\r\n\r\n // Add some objects with repetitive keys\r\n if (i % 2 === 0) {\r\n obj.address = {\r\n street: \u0027123 Main St\u0027,\r\n city: \u0027Anytown\u0027,\r\n state: \u0027CA\u0027,\r\n zip: \u002712345\u0027,\r\n };\r\n } else {\r\n obj.address = {\r\n street: \u0027456 Oak Ave\u0027,\r\n city: \u0027Somewhere\u0027,\r\n state: \u0027NY\u0027,\r\n zip: \u002767890\u0027,\r\n };\r\n }\r\n\r\n queue.push(obj);\r\n}\r\n\r\nvar existingObj = {\r\n id: 24,\r\n model: \u0027Ford\u0027,\r\n}","TestCases":[{"Name":"object assign","Code":"for (let i = 0; i \u003C queue.length; i\u002B\u002B) {\r\n existingObj = Object.assign(existingObj, queue[i]);\r\n}","IsDeferred":false},{"Name":"Inner for loop","Code":"for(let i = 0; i \u003C queue.length; i\u002B\u002B) {\r\n for(let key in queue[i]) {\r\n if(queue[i][key] !== undefined) {\r\n existingObj[key] = queue[i][key]\r\n }\r\n }\r\n}","IsDeferred":false}]}