How to use for loop with multiple variables of the same type in TypeScript

1 Answer

0 votes
for (let i = 0, j = 10; i < 10 && j > 0; i++, j--) {
      console.log(i, j);
}
          
 
  
  
  
/*
run:
  
0,  10
1,  9
2,  8
3,  7
4,  6
5,  5
6,  4
7,  3
8,  2
9,  1
  
*/

 



answered Jan 5, 2022 by avibootz

Related questions

...