Created
November 26, 2013 01:40
-
-
Save nola/7652131 to your computer and use it in GitHub Desktop.
JS operators shorthand
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| x=x+1; | |
| minusCount = minusCount - 1; | |
| y=y*10; | |
| //shorthand version | |
| x++; | |
| minusCount --; | |
| y*=10; | |
| //Another way | |
| //Other shorthand operators, given that x=10 and y=5, the table below explains the assignment operators: | |
| x += y //result x=15 | |
| x -= y //result x=5 | |
| x *= y //result x=50 | |
| x /= y //result x=2 | |
| x %= y //result x=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment