---
meta:
  title: Subtraction operator
  description: This operator subtracts one value from another
---

Subtraction behaves in the same way as the [addition](/operator/addition)
operator.

```javascript
console.log(1 - 1); // 0
```

However, you can't subtract a number from a string.

```javascript
console.log("test" - 1); // NaN
```
