JavaScript Coercion, Order Precedence and associativity can be confusing but I use below link to understand it,
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence
But I am still not getting why "1"+"1"
resulting into "11"
and "1"- - "1"
resulting into 2
,
- -
should be converted to +
and it should process like "1"+"1"
, What am I missing here?
You can test it here:
console.log("1" + "1");
console.log("1"- - "1");