Explain to me my own code pls )


Hey. I was solving the Mutations algorithm, decided to play around a bit and suddenly encountered the decision. The only thing - I don’t quite understand how it works))). It’s like somehow filter knows that it need to filter out NaN, null etc. How can that be, I didn’t write any statements? Could you please explain this to me and comment on the code:
function bouncer(arr) {
function cleaner(arr)
{return arr;}
return arr.filter(cleaner);
bouncer([false, null, 0, NaN, undefined, “”]);


Looks like Falsy Bouncer rather than Mutations

The explanation is below


It’s Bouncer. ofc) Do I get this right - NaN, underfined and so on equal false in Booleans?


yes - you got it right


Tnx for explanation!