JavaScript example of an Array Foreach Loop code.
var colors = ["red", "blue", "green"];
colors.forEach(function(color) {
console.log(color);
});
Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.