I think you’re overthinking things a little. For instance the Javascript Boolean() method could be used with filter to remove falsy values from an array. Or, as hinted by the link, there’s an even simpler approach. You can pass the challenge simply by changing the given return statement (which was ‘return arr’).
Remember that you can filter an array using any condition and variables are already or truthy or falsy, so… filter
Since they want you return a new array with different values, map even looks better for me. map
As @igorgetmeabrain suggested you, you could map your array and return an array of falsy values converted to booleans.
Don’t be to hard with yourself, in my experience is better read the challenge, try to understand it ( this is key), read about some methods and try something. Do this for 5-10 min (+ reading) and go to another task (if you are rested, you could jump to next algorithm as well ) or back later or even tomorrow to the challenge. I found much easier to solve challenges giving time to my brain to think about it on background. As newies we focus too much at first solution it comes out and we should think deeper in the question first.
The other greates reference for JavaScript is javascript.info page, fully recommended.
I hope this help, keep working and reward yourself for trying too. Happy coding!!
& is a bitwise operator and is rarely used in javascript. && is the logical operator which is what you are chasing after, as you are differentiating between truthy and falsy elements.