I am trying to get the count of occurrences in the below object.
arr = [{"name":"rahul","age":23}, {"name":"Jack","age":22},{"name":"James","age":23}]
From the above array obj I want to get the count of people whose age is 23. In this case the expectation is 2.
I tried:
myArray.filter(x => x == searchValue).length;
But didn't get the exact answer as my declaration of array is different.
Please do let me know anyother way that I can use for this.