While working with strings, there are some important properties that need to be taken care of,
- Strings are immutable. This means that they cannot be reassigned characters. For example, in the example below, we will get an error of item assignment as reassignment of characters is not allowed.
JAVASCRIPT
1var name = "Lee";
2name[0] = "T";
3console.log(name); // 'Lee'
- To include single quotation inside a string, we need to use double quotation marks to declare them. We cannot use single quotation marks to declare the string if we want to use single quotation marks inside the string.