javascript for each loop
var colors = ["red", "blue", "green"];
colors.forEach(function(color) {
console.log(color);
});
javascript for each loop
var colors = ["red", "blue", "green"];
colors.forEach(function(color) {
console.log(color);
});
for-each loop in java
// for each loop in java example
import java.util.*;
public class ForEachLoopExample
{
public static void main(String[] args)
{
int[] numbers = {2, 4, 6, 8, 10};
// for each loop
for(int n : numbers)
{
System.out.println(n);
}
}
}
for each
const array1 = ['a', 'b', 'c'];
array1.forEach(element => console.log(element));
// expected output: "a"
// expected output: "b"
// expected output: "c"
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us