Arrays in Javascript

Arrays

Arrays are a variable containing a collection, such as images/names/functions. They are enclosed with brackets "[...]"'s. They are written before functions involving them so that they are remembered when called upon. These are also named by the programmer, and are linked within methods as [.]'s.

Example:

var idNames = [
"hero1",
"hero2",
"hero3",
"hero4",
"hero5",
"heroX" ]


Properies and Methods

Properies: gives back information about the called array and requires no parenthesies.

Example:

Array1.length /// This property returns number of all the values in the array.///





Methods: Opperate on the array, and requires parentheses with it.

Example:

Array1.shift() /// This property gets rid of the first value [0] of an array.