• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 11. Arrays > Adding Elements to an Array

11.7. Adding Elements to an Array

You can add elements to an array by specifying a value for a new element, increasing the array's length property, or using one of the built-in array functions.

11.7.1. Adding New Elements Directly

We can add a new element to an existing array at a specific index simply by assigning a value to that element:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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