Answers for "node js for each"

35

for each js

const fruits = ['mango', 'papaya', 'pineapple', 'apple'];

// Iterate over fruits below

// Normal way
fruits.forEach(function(fruit){
  console.log('I want to eat a ' + fruit)
});
Posted by: Guest on March-29-2020
23

foreach jas

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

array1.forEach(element => console.log(element));
Posted by: Guest on January-10-2020
1

boucle foreach js

let listeDePays = ['France', 'Belgique', 'Japon', 'Maroc'];
listeDePays.forEach(pays => console.log(pays));
Posted by: Guest on March-13-2020
0

javascript for each

const emperors = [{
   name: 'D. Luffy',
   age: 10
},{
   name: 'Jhey',
   age: 30
}];

emperors.forEach(emperor => console.log(`${emperor.name} is ${emperor.age} years old `));
Posted by: Guest on May-24-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language