DEV Community

[Comment from a deleted post]
Collapse
 
maestromac profile image
Mac Siri

Consider the following.

a = 1

a += 1  # 'a' would be 2 here.
# is the same as
a = a + 1

Hence

a = 1 

a ||= 2 # 'a' would be 1 here.
# which is just another way to write 
a = a || 2