Remember that this means assignment not equals.
Equals is == and strictly equals is this ===
I get what you are trying to say here but this is not the correct way to write this statement.
I get that you are trying to say. if arr[i] equals undefined or null or NaN, etc.
But the correct way to write this would be
if(arr[i] === undefined || arr[i] === null ....
But there is a much simpler way to solve this problem.
We want to return an array with only truthy values right?
We could create a variable and assign an empty array to it.
Then by definition of the if statement, if the current element in the array is truthy then we can just push that to a new array and return that new array.
Here is the documentation for if statements
That approach is simpler than trying to write a lengthy if statement for all falsey values and then trying to remove them from the array.