what is ||= in ruby? [duplicate]

It’s a conditional assignment. If the variable is nil or false it will be replaced with the value on the right hand side; if it already has a value other than nil or false it will keep that value.

Leave a Comment