Skip to content

Instantly share code, notes, and snippets.

Created January 12, 2018 01:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/9593113c3a4323692676d44f5adaa9c9 to your computer and use it in GitHub Desktop.
Save anonymous/9593113c3a4323692676d44f5adaa9c9 to your computer and use it in GitHub Desktop.
Expression Left-Associative LA Result Right-Associative RA Result Expected result Conclusion
1 == 1 == true (1 == 1) == true true 1 == (1 == true) false ?? Which one is right?
1 - 2 - 3 (1 - 2) - 3 -4 1 - (2 - 3) 2 -4 LA is ok
1 + 2 + 3 (1 + 2) + 3 6 1 + (2 + 3) 6 +6 Both LA and RA is ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment