A. JavaScript Basics
1.try...catch uses lowercase letters. Uppercase letters can go wrong.
2.Throw statement
The purpose of the throw declaration is to create a exception (exception). You can use this declaration in conjunction with the Try...catch declaration to achieve the purpose of controlling the flow of the program and generating accurate error messages.
Grammar:
Throw (Exception)
Exception can be a string, an integer, a logical value, or an object.
Note: Write throw with lowercase letters. Using uppercase letters makes an error!
3. A backslash is used to insert ellipses, line breaks, quotes, and other special characters in a text string.
The following table lists the remaining special characters that can be added to a text string using a backslash:
Code output
\ ' Single quotes
\ "Double Quotes
\& and number
\ reverse Slash
\ n Line Feed
\ r return character
\ t tab
\b Backspace
\f Page Breaks
4.JavaScript ignores extra spaces. So you can add the appropriate spaces in your code to make your code more readable.
5.
You can use backslashes to wrap code within a text string. The following example is correct:
document.write ("Hello \
world! ")
But you can't fold like this:
document.write \
("Hello world!")