Arrays part 1

JavaScript Arrays



Arrays store multiple values in a single variable

To store three course names, you need three variables.var course1 ="HTML";
var course2 ="CSS";
var course3 ="JS";

But what if you had 500 courses? The solution is an array.var courses = new Array("HTML", "CSS", "JS");
This syntax declares an array named courses, which stores three values, or elements.

Comments

Popular posts from this blog

String Operators

Introducing object part 3

The math object part 2