how to put to an array foreach loop code example
Example 1: javascript forEach loop array
array.forEach(function calback(item, index, array)
{
/* working codes here */
});
Example 2: how to use the foreach fnction javascript loop through array
const names = ['Anthony','Stacey','Mason','Gracie','Koda','Nani'];
forEach(function(name) {
console.log(name);
});