should I use for of loop js code example
Example 1: for of js
let panier = ['fraise', 'banane', 'poire'];
for (const fruit of panier) {
// console.log(fruit);
console.log(panier.indexOf(fruit));
}
Example 2: javascript for of
const numbers = [1,2,3,4];
for(const item of numbers){
console.log(item);
}