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

Loops

Another useful feature of JavaScript—and most other programming languages—is the ability to create loops, or groups of statements that repeat a certain number of times. For example, these statements display the same alert ten times, greatly annoying the user:

for (i=1;i<=10;i++) {
   Alert("Yes, it's yet another alert!");
}


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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