Skip to content

Instantly share code, notes, and snippets.

@philip13
Created April 17, 2015 18:32
Show Gist options
  • Save philip13/f2fffffbb03882c52403 to your computer and use it in GitHub Desktop.
Save philip13/f2fffffbb03882c52403 to your computer and use it in GitHub Desktop.
Ruby basic: CONDITIONAL ASSIGNMENT-The operator? ||=
a += b same as a = a + b
a -= b same as a = a - b
a *= b same as a = a * b
a ||= b same as a = a || b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment