JAVASCRIPT Questions and Answers

What are escape characters?

Escape characters (Backslash) is used when working with special characters like single quotes, double quotes, apostrophes and ampersands. Place backslash before the characters to make it display.

Example:

JavaScript

1
2
3

document.write “I m a “good” boy”
document.write “I m a \”good\” boy”