This is how it should work - When I call the function it should return a blank array but right now it's outputting [null,0,null,null,""]. Here's what I have so far.
Code: Select all
function bouncer(arr) {
for(i=0;i<arr.length;i++){
if(arr[i]===false||null||0||undefined||NaN||""){
arr.splice(i,1);
}
}
return arr;
}
bouncer([false, null, 0, NaN, undefined, ""]);