{"ScriptPreparationCode":"var arr = [2, 3, 1, 3, 4, 5, 3, 1];","TestCases":[{"Name":"forEach","Code":"function getOccurrence(array, value) {\r\n var count = 0;\r\n array.forEach((v) =\u003E (v === value \u0026\u0026 count\u002B\u002B));\r\n return count;\r\n}\r\nconsole.log(getOccurrence(arr, 1));","IsDeferred":false},{"Name":"filter","Code":"function getOccurrence(array, value) {\r\n return array.filter((v) =\u003E (v === value)).length;\r\n}\r\nconsole.log(getOccurrence(arr, 1));","IsDeferred":false}]}