{"ScriptPreparationCode":"var arrLength = 100;\r\nvar arr = new Array(arrLength).fill().map((_, idx) =\u003E ({ id: idx }));\r\nvar foo = Math.floor(Math.random() * arrLength);\r\n\r\nfunction _findUser(id) {\r\n const userIdx = _(arr).findIndex({ id });\r\n return arr[userIdx] || null;\r\n}\r\n\r\nvar userEnum = {};\r\nfunction findUser(id) {\r\n if (Object.keys(userEnum).length === 0) {\r\n \t_(arr).each(user =\u003E userEnum[user.id] = user);\r\n }\r\n return userEnum[id] || null;\r\n}","TestCases":[{"Name":"enum","Code":"findUser(foo);","IsDeferred":false},{"Name":"lodash","Code":"_findUser(foo);","IsDeferred":false}]}