Question: What does the following evaluate to? 

```
"1"+2+4

```

What about this:

```
5 + 4 + "3"

```

In the first case since `"1"` is a string, everything is a string, so the result is `"124"`. In the second case, its `93`.what is happening here? Why does addition happen in one instance, while string concatenation occurs in the other?

```
var x = "1" + 2 + 4;
var z = 5 + 4 + "3";
console.log(x); // "124"
console.log(z); // 93 

```

Can anyone explain this?

Answer: 
expression evaluates from left to right.

```
"1"+2+3
 ^--^
"12" //string  +3
  ^_____________^
 "123"  //string

```

in 2nd case

```
 1+2+"3"
 ^_^
  3+"3"
  ^___^
  "33" // string

```
In both case apply the type conversion and left to right precedence.
in first one,

```
var x = "1" + 2 + 4; // 124

```

compiler take 1 as string and after that it will concatenating with 2 now 12 is the string so it will concatenate with 4 and result will produce "124" as string.

```
var z = 5 + 4 + "3"; // 93

```

in Second one,
 first 5 and 4 is numeric so make addition and result will be 9. and this will concatenate with string 3 soo output will be 93 as string.