My code passes the challenge but this is the first time I’ve seen an “if conditional” with this syntax. Why isn’t the “if statement” wrapped in curly brackets and why isn’t it below the “if condition”? Please help me to understand, thanks.
**Your code so far**
function bouncer(arr) {
let truthyArr = []
for(let i = 0; i < arr.length; i++){
if(arr[i]) truthyArr.push(arr[i])
}
return truthyArr
}
bouncer([7, "ate", "", false, 9]);
**Your browser information:**
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
Challenge: Falsy Bouncer
Link to the challenge: