Answers for "javascript add string inside foreach"

1

javascript add string inside foreach

var fruits = [1, 2, 3];
fruits.forEach(myFunction);

function myFunction(item, index) {
  document.getElementById("demo").innerHTML += index + ":" + item + "<br>"; 
}
Posted by: Guest on March-23-2021

Code answers related to "javascript add string inside foreach"

Code answers related to "Javascript"

Browse Popular Code Answers by Language