foreach w3schools javascript

JavaScript
/* Answer to: "foreach w3schools javascript" */

var fruits = ["apple", "orange", "cherry"];
fruits.forEach(function(item, index) {
  document.getElementById("demo").innerHTML 
  += index + ":" + item + "<br>"; 
});
Source

Also in JavaScript: