I have the following javascript array:
var foo = [false,false,true,false,true];
What I want is to remove 'true' values and keep false like this:
[false,false,false]
I have tried this:
console.log(foo.map(function(i){if(i==false)return i;}));
but what i get is :
[ false, false, undefined, false, undefined ]
Any ideas how to accomplish this?