I am currently working with a javascript array called 'foo' which looks like this:
var foo = [false,false,true,false,true];
My goal is to eliminate all the 'true' values and only keep the 'false' ones, resulting in this array:
[false,false,false]
I attempted to achieve this using the following code:
console.log(foo.map(function(i){if(i==false)return i;}));
However, the output I received was:
[ false, false, undefined, false, undefined ]
Do you have any suggestions on how I can successfully accomplish this task?