> For the complete documentation index, see [llms.txt](https://learning.pavey.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learning.pavey.dev/javascript/js-basics/operators.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
