JavaScript Operators
Overview
In programming, operators are special symbols (characters) that are used to perform operations on operands (variables and values) and to process expressions. Most operators are used to perform mathematical operations such as addition, subtraction, multiplication, etc. However, there are other operators that are used to perform other operations such as assignment, comparison, logical, string, conditional, etc.
Prepare
It is essential if fundamental programming that you understand the types of operators.
Types of Operators
- Assignment - used to assign values to variables. Tutorial
- Arithmetic - used to preform arithmetic. Tutorial
- Comparison - Tutorial
- Logical - important to create compound conditions as they determine the logic between expressions/values.
- Conditional (ternary) - alternative to if...else statement. Reference
- Spread (...) - this was used in the task last week. Reference
References
- Reference JavaScript Operators Reference - w3schools.com
- Reference More depth reference on Expressions and Operators
Check Your Understanding
- Operators and Comparisons - practice answering the questions and reviewing the examples.
Optional Resources
- Self Check: Using this article, Numbers, Operators, and Comparisons, can you complete the Test your skills: Math?
- Self Check: Using this article, Strings and Numbers, can you complete the Test your skills: Strings?