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
I'm pretty sure @thejh 's answer was good enough to check empty string BUT, I think we frequently need to check that 'Does it exist?' and then we need to check 'Is it empty? include string, array and object'
This is the shorten way for CoffeeScript to do this.
tmp? and !!tmp and !!Object.keys(tmp).length
If we keep this question order, that would be checked by this order 1. does it exist? 2. not empty string? 3. not empty object?
so there wasn't any problems for all variable even in the case of not existed.