Comparison between &&= and ||=
&&= ||=
Example 1 x=5 x=5
y=7 y=7
x&&=y x||=y
X=7 x=5
y=7 y=7
Example 2 x=nil x=nil
y=7 y=7
x&&=y x||=y
x=nil x=5
y=7 y=7
Example 3 x=5 x=5
y=nil y=nil
x&&=y x||=y
x=nil x=5
y=nil y=nil
Example 1 x=5 x=5
y=7 y=7
x&&=y x||=y
X=7 x=5
y=7 y=7
Example 2 x=nil x=nil
y=7 y=7
x&&=y x||=y
x=nil x=5
y=7 y=7
Example 3 x=5 x=5
y=nil y=nil
x&&=y x||=y
x=nil x=5
y=nil y=nil
Comments
Post a Comment