Data type part 4

Data Types
32
4/5













Strings
As strings must be written within quotes, quotes inside the string must be handled. The backslash (\) escape character turns special characters into string characters.
Result:
The escape character (\) can also be used to insert other special characters into a string.
These special characters can be added to a text string using the backslash sign.
If you begin a string with a single quote, then you should also end it with a single quote. The same rule applies to double quotes. Otherwise, JavaScript will become confused.
Please enter the corresponding characters to enable the display of the whole string:
var s = "I think
"JavaScript is
easy
" ";
document.write(s)
easy
document.write(s)
Comments
Post a Comment