Edit in JSFiddle

//JavaScript Arrays

//create an array:
var str = []; //this is an array with no data

var cars = [
  'Toyota',
  'Honda',
  'Acura',
  'Lexus',
  'Maserati',
  'Mercedes',
  'Subaru'
];

console.log(cars);
console.log("the array cars has " + cars.length + " values");
document.getElementById("myArray1").innerHTML = cars;

//grab one value
console.log(cars[6]);
document.getElementById("myArray1").innerHTML += " " + cars[6];

//create an array using new
var num = new Array(5,2);
console.log(str.length);

document.getElementById("myArray2").innerHTML = num;
<!-- Easy JavaScript #13 - Arrays! -->

<p>
  JavaScript Arrays are global objects used to create Arrays. Arrays are special variables used to store a list of data, delimited by commas. Note: All arrays are Zero indexed and they are numbered indexes (objects are named indexes).
</p>
<p>
  Syntax of an declaring and defining array, Method 1: var month = ['January','February','March'];
</p>
<p>
  Syntax of Declaring and defining an array, Method 2: var month = new Array('January', 'February','March')
</p>
<p>
  Accessing an array item uses the following Syntax: month[0] will return 'January'.
</p>
<p>
  JavaScript doesn't allow associative arrays. You can do it, but it will be turned into a regular objects and all properties and methods run on it will not be as expected. But you can have multipel types of values in the same array! You can have strings, numbers, booleans, and even other arrays in your array!
</p>

<div id="myArray1"></div>
<div id="myArray2"></div>

<p>
Visit <a href="http://www.easyprogramming.net">Easy Programming</a> for more information. 
</p>
#myArray1, #myArray2{
   font-size: 25px;
   line-height: 35px;
}