# Operators

Operators are a type of construct which represents an action or relationship. We can use them to compare  and modify values. You are already familiar with some of the more common operators, such as the ones commonly used in mathematical expressions.

### Math Operators

* `+` Addition
* `-` Subtraction
* `*` Multiplication
* `/` Division
* `%` Remainder
* `**` Exponent

These work largely the same as their math counterparts, and can be used to combine values into new values resulting from the expressions you write.

```
var sumOfNumbers = 1 + 3;
alert(sumOfNumbers);
```

### Comparison Operators

While the previous operators are used to create and modify values, these ones are used to compare values. The most common ones are:

* `==` Equal to
* `===` Identical to
* `>` Greater than
* `<` Less than
* `>=` Greater than or equal to
* `<=` Less than or equal to

There is an important distinction between `==` and `===` which is that the "equal to" operator essentially only compares that two values are equivalent, while the "identical to" operator checks that the identity of the values is also the same. What this means is that the "identical to" operator also checks the type of the variable.

Because of this, the following occurs:

`"1" == 1; // true` . This is true because the values are equivalent when not considering the types

`"1" === 1; //false` . This is false, because even though the values are equivalent, they are different types (string vs number) so they are not identical


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learning.pavey.dev/javascript/js-basics/operators.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
