Coding Manifestation Logo
Lesson 9

Operators

Operators are special symbols that perform operations on one, two, or more operands (values or variables).

+×÷=
  • Arithmetic Operators
  • Assignment Operators
  • Comparison Operators
  • Logical Operators
  • Unary Operators
  • Ternary Operator
+
Arithmetic

Perform mathematical operations.

a + b, a - b
=
Assignment

Assign values to variables.

a = b, a += b
==
Comparison

Compare two values and return boolean.

a == b, a > b
&&
Logical

Combine multiple conditions.

a && b, a || b
!
Unary

Operate on a single operand.

++a, !a
?
Ternary

Conditional operator (shorthand if-else).

a ? b : c
JavaScript
Output
Your output will appear here...
  1. 1( )
  2. 2++ -- !
  3. 3* / %
  4. 4+ -
  5. 5< <= > >=
  6. 6== != === !==
  7. 7&&
  8. 8||
  9. 9? :
  10. 10= += -= *= /= %=
Higher precedence operators are evaluated first.

Use parentheses to change the order of evaluation.

let result = (2 + 3) * 4;
Arithmetic
+, -, *, /, %, **
Assignment
=, +=, -=, *=, /=, %=
Comparison
==, !=, ===, !==, >, <, >=, <=
Logical
&&, ||, !
Unary
++, --, !, +, -
Ternary
condition ? a : b
PrevNext