I have an array:
[1, 2, 3, 5, 2, 8, 9, 2]
I would like to know how many 2
s are in the array.
What is the most elegant way to do it in JavaScript without looping with for
loop?
I have an array:
[1, 2, 3, 5, 2, 8, 9, 2]
I would like to know how many 2
s are in the array.
What is the most elegant way to do it in JavaScript without looping with for
loop?