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

Q&A

Q1:Can one of an object's properties be another object?
A1: Absolutely. In this case, the second object is called a child object. You'll encounter quite a few parent and child objects, such as window.location, in Hour 10.
Q2: You mentioned that the properties of the Math object are constants. What are they?
A2: They include a wide variety of mathematical constants, such as Math.PI and Math.E. A wide variety of more esoteric constants are included. There are also some methods of the Math object that weren't discussed here, such as the trigonometric functions. For details, see the JavaScript quick reference in Appendix D, “JavaScript Quick Reference.”
Q3: I tried the random number example in Listing 9.3, and I'm surprised it takes more than a few seconds to add a few numbers together—aren't computers supposed to be really good at that sort of thing?
A3: Actually, the slowest part of the loop in the example script is the command that updates the status line. If you remove this command, the script will execute much faster—but you won't be able to watch its progress.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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