{"ScriptPreparationCode":null,"TestCases":[{"Name":"findIndex","Code":"const questionIds = Array.from({length: 1000}, () =\u003E {\r\n const index = Math.floor(Math.random() * 1000);\r\n return {name: \u0060test${index}\u0060, id: index};\r\n});\r\nconst allQuestions = Array.from({length: 1000}, (_, i) =\u003E {\r\n const index = i \u002B 1;\r\n return {name: \u0060test${index}\u0060, id: index};\r\n});\r\n\r\nconst selectedQuestions = [];\r\nfor (const questionId of questionIds) {\r\n const questionIdIndex = allQuestions.findIndex(question =\u003E question.id === questionId);\r\n if (questionIdIndex !== -1) {\r\n selectedQuestions.push(allQuestions[questionIdIndex]);\r\n }\r\n}","IsDeferred":false},{"Name":"Map","Code":"const questionIds = Array.from({length: 1000}, () =\u003E {\r\n const index = Math.floor(Math.random() * 1000);\r\n return {name: \u0060test${index}\u0060, id: index};\r\n});\r\nconst allQuestions = Array.from({length: 1000}, (_, i) =\u003E {\r\n const index = i \u002B 1;\r\n return {name: \u0060test${index}\u0060, id: index};\r\n});\r\n\r\nconst questionMap = new Map();\r\nallQuestions.forEach(origQuestion =\u003E {\r\n questionMap.set(origQuestion.id, origQuestion);\r\n});\r\nconst tmpQuestions = [];\r\nquestionIds.forEach(questionId =\u003E {\r\n if (questionMap.has(questionId)) {\r\n const question = questionMap.get(questionId);\r\n tmpQuestions.push(question);\r\n }\r\n});","IsDeferred":false}]}