Sams Teach Yourself JavaScript in 24 Hours

Sams Teach Yourself JavaScript in 24 Hours

By Michael Moncur

Quiz

Test your knowledge of avoiding and debugging JavaScript errors by answering the following questions.

Questions

1:

If you mistype a JavaScript keyword, which type of error is the result?

  1. Syntax error
  2. Function error
  3. Pilot error
A1:

a. A syntax error can result from a mistyped JavaScript keyword.

2:

The process of dealing with errors in a script or program is known as:

  1. Error detection
  2. Frustration
  3. Debugging
A2:

c. Debugging is the process of finding and fixing errors in a program.

3:

Which of the following is a useful technique when a script is not working but does not generate an error message?

  1. Rewriting from scratch
  2. Removing <script> tags
  3. Adding alert statements
A3:

c. You can add alert statements to a script to display variables or the current status of the script and aid in debugging.

Share ThisShare This

Informit Network