{"ScriptPreparationCode":"function createTeamList(n) {\r\n var teamList = Array(n);\r\n for (var i = 0; i \u003C n; i\u002B\u002B){\r\n teamList[i] = {\r\n id: i,\r\n isSelected: true,\r\n name: \u0060team ${i}\u0060\r\n }\r\n }\r\n return teamList;\r\n}\r\n\r\nvar searchableTeamList = createTeamList(100000);","TestCases":[{"Name":"reduce","Code":"const selectedTeamIds = searchableTeamList.reduce((ids, team) =\u003E {\r\n if (team.isSelected) {\r\n ids.push(team.id)\r\n }\r\n return ids;\r\n}, []);","IsDeferred":false},{"Name":"filter\u002Bmap","Code":"const selectedTeamIds = searchableTeamList.filter((team) =\u003E team.isSelected)?.map((team) =\u003E team.id);","IsDeferred":false},{"Name":"forEach","Code":"const selectedTeamIds = [];\r\nsearchableTeamList.forEach((team) =\u003E {\r\n if (team.isSelected) {\r\n selectedTeamIds.push(team.id)\r\n }\r\n});\r\n ","IsDeferred":false},{"Name":"for...of","Code":"const selectedTeamIds = [];\r\nfor (const team of searchableTeamList) {\r\n if (team.isSelected) {\r\n selectedTeamIds.push(team.id)\r\n }\r\n}\r\n ","IsDeferred":false}]}