
So you think you know Ruby - singularity2001
Computer science 101: 
what is the value of x,y,z after these calculations:<p>x = true and false<p>y = 1 &amp;&amp; 0 || 1<p>z = ( true or true and false )<p>Before typing this in your ruby irb console, please answer in your head what you honestly think the answer should be.<p>spoiler: [x,y,z]
=&gt; [true, 0, false]
======
haalcion3
Read:

[https://ruby-
doc.org/core-2.3.0/doc/syntax/precedence_rdoc.h...](https://ruby-
doc.org/core-2.3.0/doc/syntax/precedence_rdoc.html)

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/](https://dorey.github.io/JavaScript-Equality-Table/unified/)

------
konart
Well, "and, or" are control flow operators, not boolean operators. I though
most of the Rubyists learn this day one tbh.

~~~
singularity2001
Is this style guide official? [https://github.com/bbatsov/ruby-style-
guide/commit/592049745...](https://github.com/bbatsov/ruby-style-
guide/commit/5920497452c1f6f604742a735f5684e86d4c0003)

