xxxxxxxxxx
const arr = [1, 2, 3, 4, 5];
console.table(arr);
xxxxxxxxxx
var array = [1,2,3]
for(var i = 0; i < array. length ; i++){
console. log(array[i])
}
//This is how you print the elements of the array if it is useful!
//-Andrew Ma
xxxxxxxxxx
var array = [1,2,3]
for(var i = 0; i < array.length ; i++){
console.log(array[i])
}
xxxxxxxxxx
var array = [1,2,3]
for(var i = 0; i < array. length ; i++){
console. log(array[i])
}
xxxxxxxxxx
// Array of primitives:
int[] intArray = new int[] {1, 2, 3, 4, 5};
//output: [1, 2, 3, 4, 5]
// Array of object references:
String[] strArray = new String[] {"John", "Mary", "Bob"};
//output: [John, Mary, Bob]
xxxxxxxxxx
for (int i=0; i < arr.length; i++) {
System.out.println(arr[i]);
}