JavaScript Operators
(Page 1 of 6 )
You can't do much with a programming language without operators. JavaScript is no exception. So this article will introduce you to JavaScript operators and what you can do with them.
Our last article left off with a brief overview of Operators. I know you didn't study them you slacker, so I will put them up here again (and it increases my word count. BOO-YAH!)
Arithmetic Operators
Operator Symbol | What it Does |
+ | Used for addition |
- | Used for subtraction |
* | Used for multiplication |
/ | Used for division |
% | Returns the remainder in division |
++ | Increments a value by 1 |
-- | Decrements a value by 1 |
Assignment Operators
Operator Symbol | What it Does |
"=" | Assigns a value to a variable |
+= | Assigns and adds a value |
-= | Assigns and subtracts a value |
*= | Assigns and multiplies a value |
/= | Assigns and divides a value |
%= | Assigns and Modulates a value |
Comparison Operators
Operator Symbol | What it Does |
"==" | Is equal to |
"===" | Is equal to both value and type |
!= | Not equal to |
> | Greater than |
< | Less than |
>= | Greater than or Equal To |
<= | Less than or Equal To |
Logical Operators
Operator Symbol | What it Does |
&& | AND |
|| | OR |
! | NOT |
Next: Arithmetic Operators >>
More JavaScript Articles
More By James Payne