ts for of loop setting type code example
Example 1: object iteration in typescript
Object.entries(obj).forEach(
([key, value]) => console.log(key, value);
);
Example 2: create an array for looping typescript
loopTimes: number[] = Array(31);
for (let x = 0; x < loopTimes.length; x++) {
console.log('Index/Loop No: ', [x]);
// Do something here...
}