Answers for "for in and for of loop in javascript"

6

for of js

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
8

javascript for of

const array = ['hello', 'world', 'of', 'Corona'];

for (const item of array) {
  console.log(item);
}
Posted by: Guest on March-13-2020
3

how to use for of in javascript

const array1 = ['a', 'b', 'c'];

for (const element of array1) {
  console.log(element);
}
Posted by: Guest on March-24-2020
2

for of loop js

const iterable = [10, 20, 30];

for (const value of iterable) {
  console.log(value);
}
// 10
// 20
// 30
Posted by: Guest on April-24-2020
0

for javascipt

for (let i = 0; i < 9; i++) {
  str = str + i;
}
Posted by: Guest on August-20-2020
2

for in javascript

let items = ['beef', 'cabbage', 'javascript']; // Defines a list of items
for (let item of items) { // Defines for loop with a variable of 'item'
  console.log(item); // Prints the item that is found
}
Posted by: Guest on October-25-2020

Code answers related to "for in and for of loop in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language