You can’t check for all falsy values like this. arr[i] === NaN will never work because NaN === NaN is false. Luckily, you don’t need to do this, because the entire idea of falsy and truthy is that falsy values act like false when treated as a boolean value and truthy values act like true when treated as a boolean value.
Modifying an array as you loop over it will make a big mess. In general, you should never splice out parts of an array as you iterate over the array.
I think you are making this a little too complicated. As @JeremyLT said, there is a much easier way to check for “falsy” values in JS. If you aren’t sure about that then a little googling will probably give you what you need.
I can see why you are modifying the original array passed into the function. I don’t think the instructions are quite clear enough. They should say, “Return a new array with all ‘falsy’ values removed from the array passed in”. It also doesn’t help that the default code has