Skip to content

Instantly share code, notes, and snippets.

@tjaved573
Last active July 1, 2022 19:08
Show Gist options
  • Save tjaved573/87315c84a19dedf798217946088bc31d to your computer and use it in GitHub Desktop.
Save tjaved573/87315c84a19dedf798217946088bc31d to your computer and use it in GitHub Desktop.
Ruby or-equals operator

||=

a || = b

is a conditional operator. Assign b to a if a is uninitialized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment