I thought it would be converted to '1'+'1' and as both are strings it will be '11' with string as datatype.
- is not a string operator. JS knows this, and will therefore do its best to convert the operands to numbers
https://javascript.info/type-conversions
Обсуждают сегодня