Precedence of Ruby operators

Updated . Posted . Visible to the public.
  1. [ ] [ ]=
  2. **
  3. ! ~ + -
  4. * / %
  5. + -
  6. >> <<
  7. &
  8. ^ |
  9. <= < > >=
  10. <=> == === != =~ !~
  11. &&
  12. ||
  13. .. ...
  14. ? :
  15. = %= { /= -= += |= &= >>= <<= *= &&= ||= **=
  16. defined?
  17. not
  18. or and
  19. if unless while until
  20. begin/end

For more information see Table 18.4 Show archive.org snapshot in The Pragmatic Programmer's Guide Show archive.org snapshot .

Profile picture of Arne Hartherz
Arne Hartherz
Last edit
Keywords
code, keywords, order, bindungsstärken
License
Source code in this card is licensed under the MIT License.
Posted by Arne Hartherz to makandra dev (2010-09-30 14:19)