{"ScriptPreparationCode":"const arr = [{ name: \u0027luna\u0027, id: 3 },{ name: \u0027abc\u0027, id: 4 }, { name: \u0027eee\u0027, id: 3 }]\r\n","TestCases":[{"Name":"map","Code":"const arr = [{ name: \u0027luna\u0027, id: 3 },{ name: \u0027abc\u0027, id: 4 }, { name: \u0027eee\u0027, id: 3 }]\r\nconst newArr = arr.map(e=\u003E ({ label: e.name, id: e.id}))","IsDeferred":false},{"Name":"foreach","Code":"const arr = [{ name: \u0027luna\u0027, id: 3 },{ name: \u0027abc\u0027, id: 4 }, { name: \u0027eee\u0027, id: 3 }]\r\nconst newArr = [];\r\n\r\narr.forEach(item =\u003E {\r\n\r\n newArr.push({ label: item.name, id: item.id })\r\n})","IsDeferred":false},{"Name":"for","Code":"const arr = [{ name: \u0027luna\u0027, id: 3 }, { name: \u0027abc\u0027, id: 4 }, { name: \u0027eee\u0027, id: 3 }];\r\nconst arrLength = arr.length;\r\nconst newArr = [];\r\nfor (let i = 0; i \u003C arrLength; i\u002B\u002B) {\r\n newArr.push({ label: arr[i].name, id: arr[i].id });\r\n}\r\n","IsDeferred":false}]}