Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Loop through array

String[] cars = {"Volvo", "BMW", "Ford", "Mazda"};
System.out.println(cars[0]);

// Change elements in array
cars[0] = "Opel";
System.out.println(cars[0]);

// Length of array
System.out.println(cars.length);

// Loop through array
for (int i = 0; i < cars.length; i++) {
  System.out.println(cars[i]);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Loop #array
ADD COMMENT
Topic
Name
2+9 =