for of js

JavaScript
let panier = ['fraise', 'banane', 'poire'];

for (const fruit of panier) {
  // console.log(fruit);
  console.log(panier.indexOf(fruit));
}let list = [4, 5, 6];

for (let i in list) {
   console.log(i); // "0", "1", "2",
}

for (let i of list) {
   console.log(i); // "4", "5", "6"
}const array = ['hello', 'world', 'of', 'Corona'];

for (const item of array) {
  console.log(item);
}
Source

Also in JavaScript: