const numb = [1, 2, 3, 4, 5];
Example:
numb.forEach(function(num) {
console.log(num);
});
Example with optional parameters:
numb.forEach((num, index) => {
console.log('Index: ' + index + ' Value: ' + num);
});
numb.forEach((num, index, array) => {
console.log(array);
});
Comments
Post a Comment