---
id: 65e97267484dd50f720e6feb
title: Learn Data Types and Conditionals Lesson F
challengeType: 15
dashedName: learn-data-types-and-conditionals-lesson-f
---
# --description--

You know that JavaScript has a variety of data types, including strings, numbers and booleans. You can use comparison operators to compare these data types and make decisions based on the results.

The following comparison operators are available in JavaScript:

| Operator | Description                              | Example      |
|----------|------------------------------------------|--------------|
| ==       | Equal (value comparison)                 | x == y       |
| !=       | Not equal                                | x != y       |
| >        | Greater than                             | x > y        |
| <        | Less than                                | x < y        |
| >=       | Greater than or equal to                 | x >= y       |
| <=       | Less than or equal to                    | x <= y       |

To use a comparison in a variable assignment, you can use the `==` operator. For example:

```javascript
let x = 5;
let y = 5;

let result = x == y;

console.log(result); // true
```


# --questions--

## --text--

Which of the following is the correct way to check if the variable `x` is equal to the number `5` in JavaScript?

## --answers--

`x = 5`

---

`x <= 5`

---

`x == 5`

---

`x >= 5`

## --video-solution--

3
