-
In JavaScript, the console keyword refers to an object, a collection of data and actions, that we can use in our code.
-
Keywords are words that are built into the JavaScript language, so the computer will recognize them and treats them specially.
-
One action, or method, that is built into the console object is the .log() method. When we write console.log() what we put inside the parentheses will get printed, or logged, to the console.
-
primitive data types
- booleans
- undefined
- numbers
- null
- strings
-
complex data types
- objects
- functions
Arithmetic Operators
An operator is a character that performs a task in our code. JavaScript has several built-in in arithmetic operators, that allow us to perform mathematical calculations on numbers.
These include the following operators and their corresponding symbols:
- Add: +
- Subtract: -
- Multiply: *
- Divide: /
- Remainder: %
Operators aren't just for numbers. When +
operator is used on two strings it appends the left string to the right string'
The process of appending one string to another is called concatenation.
The .
is another operator! We call it the dot operator.
We call or use methods by appending an instance with a period or the dot operator.