What’s the problem with my syntax? Each condition is correct but null is not acceptable… Can you help me?
function bouncer(arr) {
var c = arr.filter(function(val){
if ( ( ( val === false ) || ( val === 0 ) || ( val === "" ) || ( val === undefined ) || ( val == isNaN ) ||
( val === null ) ) ) {
return false;
}
else {
return true;
}
});
return c;
}
bouncer([1, null, NaN, 2, undefined]);