{"ScriptPreparationCode":null,"TestCases":[{"Name":"mapValues (every item uniq)","Code":"const obj = [];\r\n\r\nfor (let i = 0; i \u003C= 10000; i\u002B\u002B) { \r\n obj.push({ id: i });\r\n};\r\n\r\nconst mapValues = () =\u003E {\r\n const inputs = Object.values(obj).map(r =\u003E r.id);\r\n const hasMulti = _.uniq(inputs).length \u003E 1;\r\n return hasMulti;\r\n}\r\n\r\nmapValues();","IsDeferred":false},{"Name":"for loop (every item uniq)","Code":"const obj = [];\r\n\r\nfor (let i = 0; i \u003C= 10000; i\u002B\u002B) { \r\n obj.push({ id: i });\r\n};\r\n\r\nconst mapFor = () =\u003E {\r\n var m = new Map();\r\n var values = Object.values(obj);\r\n for (let i = 0; i \u003C values.length; i\u002B\u002B) { \r\n var id = values[i].id;\r\n\tm.set(id, 0);\r\n if (m.size \u003E 1) {\r\n return true;\r\n }\r\n };\r\n \r\n return false;\r\n};\r\n\r\nmapFor();","IsDeferred":false},{"Name":"mapValues (all items same)","Code":"const obj = [];\r\n\r\nfor (let i = 0; i \u003C= 10000; i\u002B\u002B) { \r\n obj.push({ id: 1 });\r\n};\r\n\r\nconst mapValues = () =\u003E {\r\n const inputs = Object.values(obj).map(r =\u003E r.id);\r\n const hasMulti = _.uniq(inputs).length \u003E 1;\r\n return hasMulti;\r\n}\r\n\r\nmapValues();","IsDeferred":false},{"Name":"for loop (all items same)","Code":"const obj = [];\r\n\r\nfor (let i = 0; i \u003C= 10000; i\u002B\u002B) { \r\n obj.push({ id: 1 });\r\n};\r\n\r\nconst mapFor = () =\u003E {\r\n var m = new Map();\r\n var values = Object.values(obj);\r\n for (let i = 0; i \u003C values.length; i\u002B\u002B) { \r\n var id = values[i].id;\r\n\tm.set(id, 0);\r\n if (m.size \u003E 1) {\r\n return true;\r\n }\r\n };\r\n \r\n return false;\r\n};\r\n\r\nmapFor();","IsDeferred":false}]}