1let someArray = [1, "string", false];
2
3for (let entry of someArray) {
4 console.log(entry); // 1, "string", false
5}
6
7var numbers = [1, 2, 3];
8for (var _i = 0; _i < numbers.length; _i++) {
9 var num = numbers[_i];
10 console.log(num);
11}
1for (let i = 0; i < 3; i++) {
2 console.log ("Block statement execution no." + i);
3}
4
1loopTimes: number[] = Array(31);
2
3for (let x = 0; x < loopTimes.length; x++) {
4 console.log('Index/Loop No: ', [x]);
5 // Do something here...
6}
1for (let entry of someArray) {
2 console.log(entry); // 1, "string", false
3}
4
5var numbers = [1, 2, 3];
6for (var _i = 0; _i < numbers.length; _i++) {
7 var num = numbers[_i];
8 console.log(num);
9}
1export const markets = ['au', 'br', 'de'] as const;
2export type Market = typeof markets[number];
3
4markets.forEach((market: Market) => {
5 console.log(market);
6});
7
1// foreach - values
2for { let item of itemList} {
3
4}
5
6// foreach - keys
7for { let key in itemList} {
8
9}
10
11// for
12for {let i = 0; i < 10; _i++}{
13
14}
15
16