Other Ways to Create Arrays part 1

         

Creating Arrays



You can also declare an array, tell it the number of elements it will store, and add the elements later.
var courses = new Array(3);
courses[0] = "HTML";
courses[1] = "CSS";
courses[2] = "JS";
Try It Yourself

An array is a special type of object.
An array uses numbers to access its elements, and an object uses names to access its members.

Comments

Popular posts from this blog

String Operators

Introducing object part 3

The math object part 2