Skip to content

Instantly share code, notes, and snippets.

@mischa
Created December 8, 2008 12:19
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 mischa/33440 to your computer and use it in GitHub Desktop.
Save mischa/33440 to your computer and use it in GitHub Desktop.
>> alien = true
>> speaks_english = false
# 1
>> alien and speaks_english ? 'hello' : '**silence**'
=> "**silence**"
# 2
>> alien && speaks_english ? 'hello' : '**silence**'
=> "**silence**"
# 3
>> speaks_english and alien ? 'hello' : '**silence**'
=> false # oops
# 4
>> speaks_english && alien ? 'hello' : '**silence**'
=> "**silence**"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment