34,333
edits
Changes
no edit summary
In the previous chapter of [[Ruby Essentials]] we looked at Ruby operators and expressions. An equally important area or to understand is operator precedence. This is essentially the order in which the Ruby interpreter evaluates expressions comprising more than one operator.
== An Example of Ruby Operator Precedence ==
== Overriding Operator Precedence ==
The precedence built into Ruby can be overided overridden by surrounding the lower priority section of an expression is with parentheses. For example:
<pre>
</pre>
In the above example, the expression fragment enclosed in parentheses is evaluated before the hight higher precedence multiplicationsmultiplication.
== Operator Precedence Table ==
The following table provides a reference when you need to to know the operator precedence used by Ruby. The table lists all operators from highest precendence precedence to lowest.
<table border="1" cellspacing="0">