I would consider this an optimal 2017 solution: const count = (list) => list.filter((x) => x == 2).length . Then use it by calling count(list) where list is an ...
確定! 回上一頁