When we subtract/multiply/divide a number with a number(type as string), it will treat both variable as number.
But when we add a number with a number(type as string), it will treat second var as string and concat the variables.
For example
var a = 4;
var b = "4";
var c;
c = a + b;
console.log(c)
c = a - b;
console.log(c)
c = a * b;
console.log(c)
c = a / b;
console.log(c)
Result output is
"44"
0
16
1
Why there is different behaviour for addition in javascript?