Skip to content

Instantly share code, notes, and snippets.

@marcusshepp
Last active June 9, 2016 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcusshepp/ebdff100fbc997cc69231001fa3122e0 to your computer and use it in GitHub Desktop.
Save marcusshepp/ebdff100fbc997cc69231001fa3122e0 to your computer and use it in GitHub Desktop.
Ampersand Equal
a, b = 1, 2
a &= b
# is the same as
a = a & b
# does a bitwise `and`
x = true
# => true
x &= true
# => true
x
# => true
x &= false
# => false
x
# => false
x &= true
# => false
x
# => false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment