Edit in JSFiddle

//JavaScript Arrays

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

var cars = [

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

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

//create an array using new
var num = new Array(5,2);

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

  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).
  Syntax of an declaring and defining array, Method 1: var month = ['January','February','March'];
  Syntax of Declaring and defining an array, Method 2: var month = new Array('January', 'February','March')
  Accessing an array item uses the following Syntax: month[0] will return 'January'.
  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!

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

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