• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Exercises

If you want to gain more experience debugging JavaScript programs, try these exercises:

  • Although the number guesser script in Listing 20.2 avoids JavaScript errors, it is still vulnerable to user errors. Add a statement to verify that the user's guess is between 1 and 100. If it isn't, display an alert message and make sure that the guess doesn't count toward the total of 10 guesses.

  • Load Listing 20.1, the number guesser script with bugs, into the JavaScript Debugger. Try using the watch and breakpoint features to quickly diagnose the problem.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint