Next →

What Are Operators?

Operators perform actions on values and variables. For example, the + operator adds two numbers, and the === operator compares two values for equality and type.

Types of Operators

1. Arithmetic Operators

Used for mathematical operations:

2. Assignment Operators

Assign values to variables:

3. Comparison Operators

Compare values and return true or false:

4. Logical Operators

Used for logical comparisons:

5. String Operators

Expressions in JavaScript

An expression is any valid set of literals, variables, operators, and functions that returns a value.
Example:
let result = (5 + 3) * 2; // 16