let num = [7, 8, 9];
num.forEach(function (value) {
console.log(value);
});
example() {
for (let item of this.items) {
if (true) {
return;
}
}
// Do stuff in case forEach has not returned
}
const proj = [
{ id: 1, estimatedBudget: 1000 },
{ id: 2, estimatedBudget: 2000 },
];
let total = 0;
proj.forEach(({ estimatedBudget }) => {
total += estimatedBudget;
});
for (let item of this.items) {
if (true) {
return;
}
}