javascript example of foreach loop

JavaScript
var colors = ["red", "blue", "green"];
colors.forEach(function(color) {
    console.log(color);
});
Source

Also in JavaScript: