Operators and Expressions
Operators are symbols that perform operations on values. They're the verbs of
programming - they make things happen!
What You'll Learn
- Arithmetic operators - Math operations like
+,-,*,/ - Comparison operators - Comparing values with
===,<,> - Logical operators - Combining conditions with
&&,||,!
Why This Matters
Every program needs to:
- Calculate values (arithmetic)
- Make decisions based on conditions (comparison)
- Combine multiple conditions (logical)
These operators are the building blocks for writing programs that can make
decisions and process data.
An expression is any piece of code that produces a value.
2 + 2 is an
expression that produces 4. Understanding expressions is key to understanding
how JavaScript evaluates your code.Let's learn how to make JavaScript do some work!