Question : For each example
Answered by : worried-warbler-3elompxjcpa9
String[] cars = {"Volvo", "BMW", "Ford", "Mazda"};
for (String i : cars) { System.out.println(i);
}
Source : | Last Update : Wed, 18 Mar 20
Question : for each
Answered by : cheerful-cod-jibxjitynnig
const array1 = ['a', 'b', 'c'];
array1.forEach(element => console.log(element));
// expected output: "a"
// expected output: "b"
// expected output: "c"
Source : | Last Update : Wed, 15 Apr 20
Question : for each loop in javascript
Answered by : coder-om
array.forEach(element => { // syntex
});
Source : | Last Update : Thu, 23 Dec 21
Question : For Each Loop
Answered by : eric-tam
String[] fruits = {"apples", "oranges", "pears", "plums"}
for (String i:fruits)
{
System.out.print(i);
}
Source : | Last Update : Wed, 29 Jun 22
Question : for-each loop
Answered by : aditya-kumdale
for (List<String> item : items) { for (String s : item) { System.out.println(s); }
}
//the for-each loop:
ArrayList<Integer> numbers = new ArrayList<Integer>();
numbers.add(1);
numbers.add(2);
numbers.add(3);
for (int number : numbers) { System.out.println(number);
}
Source : | Last Update : Sun, 22 Jan 23
Question : For Each Loop
Answered by : paulo-di-sciascio
public class ForeachLoop : MonoBehaviour
{ void Start () { string[] strings = new string[3]; strings[0] = "First string"; strings[1] = "Second string"; strings[2] = "Third string"; foreach(string item in strings) { print (item); } }
}
Source : | Last Update : Mon, 12 Jun 23
Question : for each
Answered by : kvz
{"tags":[{"tag":"textarea","content":"List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5);\nfor (int number : numbers) {\n System.out.println(number);\n}\n","code_language":"java"}]}
Source : | Last Update : Thu, 26 Jan 23