Answers for "how to sum elements using foreach in js"

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
0

foreach loop javascript

listName.forEach((listItem) => {
  Logger.log(listItem);
}):
Posted by: Guest on November-17-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language