foreach in angular 6 ts file code example
Example 1: foreach typescript
example() {
for (let item of this.items) {
if (true) {
return;
}
}
// Do stuff in case forEach has not returned
}
Example 2: foreach typescript
for (let item of this.items) {
if (true) {
return;
}
}