So you think you know Ruby
Computer science 101:
what is the value of x,y,z after these calculations:
x = true and false
y = 1 && 0 || 1
z = ( true or true and false )
Before typing this in your ruby irb console, please answer in your head what you honestly think the answer should be.
spoiler: [x,y,z] => [true, 0, false]
(
3 comments
| on HN
)
https://ruby-doc.org/core-2.3.0/doc/syntax/precedence_rdoc.h...
Live it. Love it. It's not that hard.
It's certainly easier than the following (granted that it isn't an order of ops thing, but it's much more convoluted):
https://dorey.github.io/JavaScript-Equality-Table/unified/