How come I can use +=
on a string, but I cannot use -=
on it?
For example...
var test = \"Test\";
var arr = \"⇔\"
Because the +
operator concatenates strings, but the -
operator only subtracts numbers from each other.
As to the why -- probably because it is difficult to determine what people want to do when they subtract strings from each other.
For example:
"My string is a very string-y string" - "string"
What should this do?