Last active
July 24, 2019 04:17
-
-
Save pixelstorm/c876944e55d3b391309134f08835a0d2 to your computer and use it in GitHub Desktop.
javascript_cheatsheet
This file contains 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
//operators | |
B O SM AS | |
operator precedent in javascript | |
Brackets pOwers (Division Multiple) (Addition Subtraction) | |
modulas operators give you the remainder (whatever is left) of any division | |
first it divides what it can | |
ie: 5 goes into 9 once with 4 left over | |
9 % 5 = 4 | |
10 % 2 = 0 (there is nothing left over from the division) | |
modulas is good for finding odd or even numbers | |
+= 30 | |
add to the existing values | |
-= 20 | |
subtract from the existing values | |
*= 2 | |
multiple existing values | |
/= 4 | |
divide existing values | |
%= 4 | |
modulas existing values | |
**= 4 | |
"to the power of (4 x existing value 4 times)" existing values | |
the plus + operator also deals with strings | |
"string" + "string" = stringstring | |
polymorphism is like playdo.. it adapts to whatever shape you need | |
"string" + 10 = string10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment