foreach class type JS code example
Example: javascript foreach syntax
const marks = [12, 17, 14];
let sum = 0;
marks.forEach(mark => {
sum += mark;
});
const marks = [12, 17, 14];
let sum = 0;
marks.forEach(mark => {
sum += mark;
});