Hi,
I checked out the solutions on this one finally. However I am not sure why the code below doesn’t work. Or ‘return val != Boolean()’ seems to work only for the first half of “” cases. Why are the other cases NaN, etc, omitted under this interpretation ?
Your code so far
function bouncer(arr) {
// Don't show a false ID to this bouncer.
var filteredArray = arr.filter(isFalse);
console.log(filteredArray);
return filteredArray;
}
function isFalse(val) {
return val != Boolean();
}
bouncer([7, "ate", "", false, 9]);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
.
Link to the challenge: