{"ScriptPreparationCode":"var records = new Array(20).fill(null).map(function (_, i) {\r\n return {toto: i, titi: \u0027hello\u0027};\r\n});\r\n\r\nvar keys = [\u0027toto\u0027];","TestCases":[{"Name":"M","Code":"Object.values(records.reduce(function (acc, record) {\r\n\tconst key = JSON.stringify(keys.reduce(function (acc, key) {\r\n acc[key] = record[key];\r\n\t return acc\r\n }, {}))\r\n\r\n\tif (!acc[key]) {\r\n\t\tacc[key] = record;\r\n\t}\r\n\treturn acc;\r\n}, {}));\r\n","IsDeferred":false},{"Name":"C","Code":"records.reduce(function (acc, cur) {\r\n const isDup = acc.some(function (item) {\r\n var isDup = true;\r\n for (const key of keys) {\r\n if (item[key] !== cur[key]) {\r\n isDup = false;\r\n }\r\n }\r\n return isDup;\r\n });\r\n if (!isDup) {\r\n acc.push(cur);\r\n }\r\n return acc;\r\n}, []);\r\n","IsDeferred":false}]}