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 think the question mark is the easiest way to call a function on a thing if the thing exists.
for example
car = {
tires: 4,
color: 'blue'
}
you want to get the color, but only if the car exists...
coffeescript:
car?.color
translates to javascript:
if (car != null) {
car.color;
}
it is called the existential operator http://coffeescript.org/documentation/docs/grammar.html#section-63