Answers for "boucle for of javascript"

1

boucle for in js

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

for (const fruit in panier) {
    console.log(panier[fruit]);
}
Posted by: Guest on March-13-2020
1

boucle for of javascript

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

for (const fruit of panier) {
  // console.log(fruit);
  console.log(panier.indexOf(fruit));
}
Posted by: Guest on March-13-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language