I\'ve got this code that checks for the empty or null string. It\'s working in testing.
eitherStringEmpty= (email, password) ->
emailEmpty = not email? or
Instead of the accepted answer passwordNotEmpty = !!password
you can use
passwordNotEmpty = if password then true else false
It gives the same result (the difference only in syntax).
In the first column is a value, in the second is the result of if value
:
0 - false
5 - true
'string' - true
'' - false
[1, 2, 3] - true
[] - true
true - true
false - false
null - false
undefined - false