I have an array like this
var arr = [{a:1, ...},{a:1, ...},{c:2, ...},{a:3, ...},{a:1, ...}]
how can I get the length of array where arr[x].a != 1 .
I know this can be done using for loop and push but I want to follow the best practise as every decent programmer should do.
P.S FYI I am using AngularJS.
EDIT 1
For anyone facing issues with arrow function in sajeetharan's answer because of ES6 script here is the solution
arr.filter(function(a){return a.a != 1}).length;