coffeescript - Why do we need to use unless and "?" together instead of if alone -
what need using unless , "?" when can use if in case
unless person.present?
is equivalent
if person.present
they're not equivalent.
dosomething() unless person.present?
execute if person.present
null
dosomething() unless person.present
execute if person.present
false
value
dosomething() if person.present
execute if person.present
true
value
check compiled javascript.
Comments
Post a Comment