Comment Comment by dumael As a compiler developer I honestly shudder reading this. From the last example:> $ node> "5" + "1"> '51'> "5" - "1"> 4How is this in anyway reasonable behavior? '+' is string concatenation but '-' is interpret these strings as numbers and perform arithmetic?Does the principle of least surprise apply here? parent dumael 11 years ago
> $ node
> "5" + "1"
> '51'
> "5" - "1"
> 4
How is this in anyway reasonable behavior? '+' is string concatenation but '-' is interpret these strings as numbers and perform arithmetic?
Does the principle of least surprise apply here?