It works because that is the definition of falsy - the filter callback return is boolean - from MDN
A falsy value is a value that translates to false when evaluated in a Boolean context
When the callback simply returns the element of the array the returned value of the callback is evaluated in a boolean context by filter to determine if the element should be kept or dropped - all returned falsy elements are evaluated as false by filter and dropped - all returned non-falsy (truthy) elements are evaluated as true by filter and kept