Access The Elements of An Array
You refer to an array element by referring to the index number.This statement accesses the value of the first element in cars:This statement modifi...Read more
Array Elements Can Be Objects
Array Properties and Methods
When to Use Arrays. When to Use objects.
How to Recognize An Array
Using Array literal notation if you put a number in the square brackets it will return the number while using new Array () if you pass a number to the constructor, you will get an array of that length. you call the Array () constructor with two or more arguments, the arguments will create the array elements.
What happens when you initialize an array with two arguments?
If you call the constructor with two or more arguments, the arguments initialize the array elements. If you only supply one argument to the Array constructor, the argument initializes the length of the new array; the new array’s elements are not initialized.