for items javascript code example
Example 1: for elem in list javascript
var myList = ["first element", "second element", "third element"];
for (let elem in myList) {
console.log(elem);
}
Example 2: for array javascript
let iterable = [10, 20, 30];
for (let value of iterable) {
value += 1;
console.log(value);
}
// 11
// 21
// 31