Strings are sequences of zero or more Unicode characters. String literals are enclosed within single or double quotes. Since CSJS involves working with HTML, a set of single quoted string literals can be embedded within a set of double quoted HTML or vice versa. For example,
<a href=“#” onClick=“alert(‘continue’)”> Click </a>
Strings are immutable in the sense that their values cannot be modified at a specific location. There is a charAt() method but nothing for setting a character at a specific location.
One of the most often used features pertaining to Strings is the concat operator. The ‘+’ operator is used for this purpose, overloaded with the (same) arithmetic operator.
Some of the basic string operations are ...