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

The with Statement

You should know about another statement when working with loops: the with statement. This statement is not a loop by itself, but it’s not all that different. It enables you to specify a default object with which the statements in the body of the with statement can work. If you make document the default object, for example, you can use write alone without having to specify document.write. Here is the syntax of this statement:

with (object){ 
   statements 
} 


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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