typescript type of in for in code example
Example 1: typescript loop over map with value as array
myMap.forEach((value: boolean, key: string) => {
console.log(key, value);
});
Example 2: foreach typescript
example() {
for (let item of this.items) {
if (true) {
return;
}
}
// Do stuff in case forEach has not returned
}