JavaScript para de
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);
}
const numbers = [1,2,3,4];
for(const item of numbers){
console.log(item);
}
let iterable = new Map([["a", 1], ["b", 2], ["c", 3]]);
for (let entry of iterable) {
console.log(entry);
}
// [a, 1]
// [b, 2]
// [c, 3]
for (let [key, value] of iterable) {
console.log(value);
}
// 1
// 2
// 3
let fruits = ["apple", "pear", "plum", "orange", "cherry"];
for(var i in fruits)
{
console.log(fruits[i]);
}