Last active
April 5, 2016 22:09
-
-
Save tomatohammado/ae8ad6279adff011719e to your computer and use it in GitHub Desktop.
Doug Crockford once discussed removing ambiguity in code. I was exploring `++` vs `+= 1` or `+=3` and it is interesting to see the return values vs the stored value in memory. some of the return values threw me off, would be nice to prepend the `>` carrot to the even numbered lines (exceptions?)
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
| var plusPlus = 1; | |
| undefined | |
| plusPlus | |
| 1 | |
| plusPlus = plusPlus+1 | |
| 2 | |
| plusPlus = plusPlus+4 | |
| 6 | |
| plusPlus = plusPlus++ | |
| 6 | |
| plusPlus | |
| 6 | |
| plusPlus++ | |
| 6 | |
| plusPlus | |
| 7 | |
| plusPlus | |
| 7 | |
| plusPlus+4 | |
| 11 | |
| plusPlus++ | |
| 7 | |
| plusPlus++ | |
| 8 | |
| plusPlus++ | |
| 9 | |
| plusPlus++ | |
| 10 | |
| plusPlus | |
| 11 | |
| plusPlus++ | |
| 11 | |
| plusPlus++ | |
| 12 | |
| plusPlus++ | |
| 13 | |
| plusPlus | |
| 14 | |
| plusPlus | |
| 14 | |
| plusPlus | |
| 14 | |
| plusPlus | |
| 14 | |
| plusPlus++ | |
| 14 | |
| plusPlus++ | |
| 15 | |
| plusPlus++ | |
| 16 | |
| plusPlus++ | |
| 17 | |
| plusPlus | |
| 18 | |
| plusPlus++ | |
| 18 | |
| plusPlus | |
| 19 | |
| plusPlus | |
| 19 | |
| plusPlus | |
| 19 | |
| plusPlus+1 | |
| 20 | |
| plusPlus += 1 | |
| 20 | |
| plusPlus | |
| 20 | |
| plusPlus += 1 | |
| 21 | |
| plusPlus += 1 | |
| 22 | |
| plusPlus += 1 | |
| 23 | |
| plusPlus += 1 | |
| 24 | |
| --- | |
| var num = 1; | |
| undefined | |
| num = num++; | |
| 1 | |
| num = num++; | |
| 1 | |
| num = num++; | |
| 1 | |
| num++; | |
| 1 | |
| num; | |
| 2 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
forgot a bunch of semicolons. Sloppy
Well, I sets me up to test my master and see if I can add the semicolons to all odd lines but the first,
after I can put a
>in front of each odd numbered line