{"ScriptPreparationCode":"var arr = [5, 5, 5, 2, 2, 2, 2, 2, 9, 4, 5, 5, 5, 2, 2, 2, 2, 2, 9, 4, 5, 5, 5, 2, 2, 2, 2, 2, 9, 4];","TestCases":[{"Name":"Using an object to hold the counts","Code":"const counts = {};\r\nfor (const num of arr) {\r\n counts[num] = counts[num] ? counts[num] \u002B 1 : 1;\r\n}","IsDeferred":false},{"Name":"Using reduce","Code":"arr.reduce(function (acc, curr) {\r\n return acc[curr] ? \u002B\u002Bacc[curr] : acc[curr] = 1, acc\r\n}, {});","IsDeferred":false}]}