September 2015
Intermediate to advanced
92 pages
1h 30m
English
CHAPTER 4
![]()
Arrays
An array is a data structure used for storing a collection of values. JavaScript arrays can be grouped into three kinds: numeric, associative, and multidimensional. The distinction between these arrays is only conceptual, as JavaScript considers them all to be array objects.
Numeric Arrays
Numeric arrays store each element in the array with a numeric index. An empty array can be created using the array constructor in the following way.
var a = new Array(); // empty array
To add elements to the array you can reference them one at a time by placing the element’s index inside square brackets. Assigning a value to an element automatically ...
Read now
Unlock full access