javascript search for element in array and return how the number of time the element is return code example
Example 1: javascript get array object by id
myArray.find(x => x.id === '45').foo;
Example 2: find all of array which satisfy condition javascript
myArray.filter(x => x > 5)