Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function bouncer(arr) {
- var newArr = arr.filter(noFalse);
- return newArr;
- }
- function noFalse(val){
- console.log(typeof val + " type");
- return (val !== false && val !== 0 && val !== undefined && !!val && val !== NaN && val !== "");
- }
- bouncer([1, null, NaN, 2, undefined]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement