if statement - Why postfix `if` in Ruby work so strange -
i have follows strange behaviour in ruby:
var1.zero? if var1 = 1
nameerror
: undefined local variable or methodvar1
main:object
from other side, if same thing in standard if
, works expected:
if var1 = 1 var1.zero? end # => false
anyone can describe how work postfix if
in ruby?
because if ask you
isn't daughter cute...
you interrupt me with
you have daughter?
before finish initial sentence was
isn't daughter cute, [showing picture]?
but if ask you
[showing picture] daughter, isn't cute?
you can respond
no
Comments
Post a Comment