Javascript operators are symbols or keywords which perform certain actions when added to a particular expression. For example, the add (+) symbol is an arithmetic operator that is used to add two variables, while the greater-than (>) or less-than (<) symbols are the comparison operators that tells the JavaScript engine to compare two values.
- Assignment Operators
- Arithmetic Operators
- Comparison Operators
- Conditional (or ternary) Operators
- Logical (or Relational) Operators
Javascript Assignment Operators
var x = 10;
Javascript Arithmetic Operators
Adding Operators
var x = 5; var y = 2; var z = x + y;
Multiplying Operators
var x = 5; var y = 2; var z = x * y;
Javascript Comparison Operators
var x = 2; var y = 9; if(y>x) { document.write("y is greater."); } else { document.write("x is greater."); }