Variables, Data Types, and Operators
- Number: Used for numeric values, such as integers and floating-point numbers.
- String: Used for text values, such as words and phrases. Strings are surrounded by quotation marks, either single or double.
- Boolean: Used for values that can only be either “true” or “false.”
- Object: Used to store collections of data and methods. Objects can be created using object literals or object constructors.
- Array: Used to store ordered collections of data. Arrays are defined using square brackets and the values are separated by commas.
- Null: Used to represent an intentional non-value, such as when a variable is declared but has not yet been assigned a value.
- Undefined: Used to represent a variable that has been declared but has not yet been assigned a value.
- Arithmetic Operators: Used for performing mathematical operations, such as addition, subtraction, multiplication, and division.
- Comparison Operators: Used for comparing values, such as equal to, not equal to, greater than, less than, and more.
- Logical Operators: Used for combining conditions, such as and, or, and not.
- Assignment Operators: Used for assigning values to variables, such as equal (=), add and assign (+=), subtract and assign (-=), and more.