Tell us what’s happening:
Describe your issue in detail here.
if I check with if (arr[i]===true) it gives wrong result,
if I do like this if(arr[i]) it gives correct results, why it is so?
**Your code so far**
function bouncer(arr) {
let newArr=[];
for (let i=0; i<arr.length; i++){
if (arr[i]===true){
newArr.push(arr[i]);
}
}
return newArr;
}
console.log(bouncer([7, "ate", "", false, 9]));
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36
Challenge: Falsy Bouncer
Link to the challenge: