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

Q&A

Q1:Can I store other types of data in an array? For example, can I have an array of dates?
A1: Absolutely. JavaScript allows you to store any data type in an array.
Q2:What about two-dimensional arrays?
A2: These are arrays with two indexes (such as columns and rows). JavaScript does not directly support this type of arrays, but you can use objects to achieve the same effect. You will learn more about objects in Hour 11, “Creating Custom Objects.”
Q3:If I assign values to array elements manually anyway, what is the advantage of using arrays?
A3: First of all, you can use a loop to work with the array elements, and use methods such as join and sort to work with the array. Arrays can also be used to store several lines of data from a form, as you'll see in Hour 14, “Getting Data with Forms.”


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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