They consist of zero or more characters delimited by quotes, either single quotes or double quotes. However, the string must end with the same quote mark it started with. For example, 'Hello' (valid), "Hello" (valid), "Hello' (invalid).
Note: There is no rule for which type of quote to use.
In the following example, we will display the string "Hello" using document.write() method.
Concatenate Two Strings
Use "+" operator to concatenate two strings.
Quote a String
To Quote a string in the middle. Do any one of the following
- Use Escapse Sequence (\') to quote a string.
- Enclose a string with double quotes to single quote a string in the middle.
- Enclose a string with single quotes to double quote a string in the middle.
Create a String using Object
new String() function to create an object string.
Please do google search for:
Join Our Channel
This channel is primarily useful for Full Stack Web Developer.