declare array in javascript

JavaScript
var cars = [

  "Saab",

    "Volvo",

    "BMW"

]; //create array
var things = ["banana", "car", "computer"];
//access array(starts at 0)
things[0]
//iterate through an array
for (var i = 0; i < things.length; i++) {
  things[i]
}var cars = ["Saab", "Volvo", "BMW"];
 //single array declaration
var car1 = "Saab";
var car2 = "Volvo";
var car3 = "BMW";

//one line
var cars = ["Toyota", "Jeep", "BMW"];

//multiple lines
var cars = [
 "Toyota",
 "Jeep",
 "BMW"
];// Initializing while declaring 
var house = ["1BHK", "2BHK", "3BHK", "4BHK"]; 
  
// Initializing after declaring 
house[0] = "1BHK";   
house[0] = "2BHK"; 
house[0] = "3BHK"; 
house[0] = "4BHK"; 
//create an array like so:
var colors = ["red","blue","green"];

//you can loop through an array like this:
for (var i = 0; i < colors.length; i++) {
    console.log(colors[i]);
}
Source

Also in JavaScript: