{"ScriptPreparationCode":null,"TestCases":[{"Name":"FOREACH","Code":"const stringCount = (strArray) =\u003E {\r\n let res = {};\r\n strArray.forEach((str) =\u003E (res[str]) ? res[str]\u002B\u002B : res[str]=1);\r\n console.log(res);\r\n}\r\n\r\nstringCount([\u0022apple\u0022, \u0022orange\u0022, \u0022peach\u0022, \u0022pear\u0022, \u0022apple\u0022]);","IsDeferred":false},{"Name":"REDUCE","Code":"const stringCount = (strArray) =\u003E {\r\n console.log(strArray.reduce((res, str) =\u003E {\r\n (res[str]) ? res[str]\u002B\u002B : res[str]=1\r\n return res;\r\n }, {}));\r\n}\r\n\r\nstringCount([\u0022apple\u0022, \u0022orange\u0022, \u0022peach\u0022, \u0022pear\u0022, \u0022apple\u0022]);","IsDeferred":false}]}