# JavaScript is Crazy 🤯

### Hello Folks 👋
What's up friends, this is **SnowBit** here. I am a young self-taught and passionate developer and have an intention to become a successful developer.

Today, I am here with a little crazy thing.

So, let's get started.

```js
console.log("5" + 5)
// Output: 55
```
Here, the output will be `55` as the string is added with a number and that will join the string with the number.
```js
console.log("Hello " + "World")
```
**When adding**:
- Two strings
- A string and a number

**will join with the string.**

When the `+` operator is used with the string is called the **concatenation** operator

Now here comes something **crazy**
```js
console.log("5" - 5)
```
The logic of the concatenation operator doesn't apply in the case of the `-` operator. Let me explain.

**Concatenation operator** can join string and add numbers, but the `-` operator can only subtract. Therefore, here `"5"` will get converted to an integer and the output will be `0` as `5 - 5` is zero.

Let's go with some other examples,
```js
console.log("8" - 4)
// Output: 4
console.log("10" - 100)
// Output: -90
```

***
Thank you for reading, have a nice day!
**Your appreciation is my motivation 😊**
- Follow me on Twitter - [@codewithsnowbit](https://twitter.com/codewithsnowbit)
- Subscribe to me on YouTube - [Code With SnowBit](https://www.youtube.com/channel/UCNTKqF1vhFYX_v0ERnUa1RQ?view_as=subscriber&sub_confirmation=1)




