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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -