What does ||= do?
Alex Jun 27
Hey DEV! Can you explain to me what
||= does in Ruby? For example,
@user ||= User.first. I can make some assumptions from the contexts in which I've seen it used, but I haven't heard a proper explanation of how it works, and it's a difficult syntax to DuckDuckGo for.