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

Using Arrays

Arrays are a powerful feature of most programming languages, and they are also available to the JavaScripter! An array enables you to store several separate values within a single variable. Usually, all these values have a connecting theme (such as days of the week). Arrays are great because when you know how to use them they can really simplify your code—saving you from having to create a bunch of separate variables with similar names.

So, let's look at how to create and use arrays. The example here will be used to hold the seven days of the week.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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