1var colors = ["red", "blue", "green"];
2colors.forEach(function(color) {
3 console.log(color);
4});
1
2array.forEach(function calback(item, index, array)
3{
4
5 /* working codes here */
6
7 });
8
1const names = ['Anthony','Stacey','Mason','Gracie','Koda','Nani'];
2
3forEach(function(name) {
4 console.log(name);
5});
6
7