Created
July 21, 2016 23:06
-
-
Save backus/c9b70dee67470698fd7d4a66ddf0384b to your computer and use it in GitHub Desktop.
What is falsey in multiple assignment?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'truthy' if (a, b = []) # => "truthy" | |
'truthy' if (a, b = nil) # => nil | |
'truthy' if (a, b = [nil]) # => "truthy" | |
'truthy' if (a, b = [nil, nil]) # => "truthy" | |
'truthy' if (a, b = [false]) # => "truthy" | |
'truthy' if (a, b = [false, false]) # => "truthy" | |
'truthy' if (a, b = [true, false]) # => "truthy" | |
'truthy' if (a, b = [false, true]) # => "truthy" | |
'truthy' if (a, b = *[]) # => "truthy" | |
'truthy' if (a, b = *nil) # => "truthy" | |
'truthy' if (a, b = *[nil]) # => "truthy" | |
'truthy' if (a, b = *[nil, nil]) # => "truthy" | |
'truthy' if (a, b = *[false]) # => "truthy" | |
'truthy' if (a, b = *[false, false]) # => "truthy" | |
'truthy' if (a, b = *[true, false]) # => "truthy" | |
'truthy' if (a, b = *[false, true]) # => "truthy" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment