Javascript has a number of string manipulation operations which can be performed on it. So we have methods like concat(), slice(), match(), etc
My question is do all these string manipulation methods return a new string value as the result OR are there some methods which actually modify the actual string being used in the method ?
Strings in JavaScript (and many other languages) are implemented as immutable objects. This has a few beneficial properties:
This also means that all string methods must return a new string if they aim to modify the original value.