Check out example codes for "foreach typescript". It will help you in understanding the concepts better.

Code Example 1

example() {
    for (let item of this.items) {
        if (true) {
            return;
        }
    }
    // Do stuff in case forEach has not returned
}

Code Example 2

for (let item of this.items) {
        if (true) {
            return;
        }
    }

Code Example 3

let num = [7, 8, 9];
num.forEach(function (value) {
  console.log(value);
});

Learn ReactJs, React Native from akashmittal.com