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

Exercises

To further your knowledge of JavaScript and loops, perform the following exercises:

  • Modify Listing 7.2 to sort the names in alphabetical order before displaying them. You can use the sort method of the Array object, described in Hour 5, “Using Strings and Arrays.”

  • Modify Listing 7.2 to prompt for exactly 10 names. What happens if you click the Cancel button instead of entering a name?


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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