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




Comments

Popular posts from this blog

How to create rails project with specific rails version?

Setup Rspec