looping through an array of customers code example
Example 1: loop through javascript array
let colors = ['red', 'green', 'blue'];
for (const color of colors){
console.log(color);
}
Example 2: java loop through array
class LoopThroughArray {
public static void main(String[] args)
{
int[] myArr = {1, 2, 3, 4};
for(int i : myArr){
System.out.println(i + "\n")
}
/* Output:
1
2
3
4
*/
}
}