javascript pour
const array = ['hello', 'world', 'of', 'Corona'];
for (const item of array) {
console.log(item);
}
2 Programmers 1 Bug
const array = ['hello', 'world', 'of', 'Corona'];
for (const item of array) {
console.log(item);
}
# For loops in Dip
for i = 0 to 5 then print(i)
for(i = 0; i < x; ++i){
//Loop, x can be replaced with any integer;
}
let arr = ["a", "b", "c"]
for (let i in arr){
console.log(i) // 0, 1, 2
}
for(let i of arr){
console.log(i) // a, b, c
}
for (variable of iterable) {
statement
}
let fruits = ["apple", "pear", "plum", "orange", "cherry"];
for(let fruit of fruits)
{
console.log(fruit);
}