## Comparison Operators

Operator | Description | JS Example |
---|---|---|

== | equal to | `a == b ` |

=== | equal value and equal type | `a === b` |

!= | not equal | `a != b` |

!== | not equal value or not equal type | `a !== b` |

> | greater than | `a > b` |

< | less than | `a < b` |

>= | greater than or equal to | `a >= b` |

<= | less than or equal to | a <= b |

? | ternary operator | x = condition? a: b |

## Tutorials

- equal to
- equal value and equal type
- not equal value or not equal type
- not equal
- greater than
- less than
- greater than or equal to
- less than or equal to

## Examples

**equal to**

```
let a = 4;
let b = 4;
output = (a == b);
console.log(output);
```

**not equal**

```
let a = 4;
let b = 4;
output = (a != b);
console.log(output);
```

**equal value and equal type**

```
let a = 4;
let b = "4";
output = (a === b);
console.log(output);
```

**not equal value or not equal type**

```
let a = 4;
let b = "4";
output = (a !== b);
console.log(output);
```

**greater than**

```
let a = 8;
let b = 4;
output = (a > b);
console.log(output);
```

**less than**

```
let a = 8;
let b = 4;
output = (a < b);
console.log(output);
```

**greater than or equal to**

```
let a = 8;
let b = 4;
output = (a >= b);
console.log(output);
```

**less than or equal to**

```
let a = 8;
let b = 4;
output = (a <= b);
console.log(output);
```