I do know that my commented out solution works so no problem with that.
I just cant wrap my head around how the sample solution checks if the values in array are falsy or not.
I do realize it happens in if statements (arr[i]) part but I don’t have the slightest idea how.
Does it call for some function that is out of our sight?
Is there some built-in functionality to check for booleans?
What is going on in the brackets? That makes no sense to me.
We have blurred this solution so that users who have not completed this challenge can read the discussion in this thread without giving away the solution.
So you are saying that (arr[i]) is read as true or false depending what is stored in the [i].
For example, if (arr[i]) that has 1 stored in [i] would be read as if I had typed in if (true)? Following the same logic all the falsy values would be read as if (false).
yes basically when the value in arr[i] is used in a contest when a boolean was expected, it is converted to a boolean, it can be a truthy or falsy value