JavaScript escape strings
special workarounds for Strings
Line breaks with \n
\n
To print output with line breaks in the console using one line of code, insert the escape sequence \n
where we want each line break to occur
Quotation marks with \"
\"
When a String
in JavaScript contains quotation marks, we would escape them with a backslash \
before each quotation mark:
Tab indents with \t
\t
Similar to \n
for line breaks, we use \t
for tab indents (4 character spaces):
Last updated