JS
See the Pen thecodelog.com - JS Arrays 1 by Deano (@deangilewicz) on CodePen.
but it is more common to create an array in the following way:
See the Pen thecodelog.com - JS Arrays 2 by Deano (@deangilewicz) on CodePen.
You can assign values to index positions in the array like this:
See the Pen thecodelog.com - JS Arrays 3 by Deano (@deangilewicz) on CodePen.
or you can assign values to a named key in the array like this:
See the Pen thecodelog.com - JS Arrays 4 by Deano (@deangilewicz) on CodePen.
You can also assign values when creating an array like this:
See the Pen thecodelog.com - JS Arrays 5 by Deano (@deangilewicz) on CodePen.
Arrays have a zero-based index, so the first item in an array has an index of 0.
All arrays have a length property which provides the total number of items in an array.
See the Pen thecodelog.com - JS Arrays 6 by Deano (@deangilewicz) on CodePen.