How to declare and initialize number array in TypeScript

1 Answer

0 votes
let arr: number[] = [5, 9, 1, 0, 43, 9388]; 
 
for (var index in arr) {
    console.log(arr[index]); 
}
 
 
 
 
/*
 
run:
 
5 
9 
1 
0 
43 
9388 
 
*/

 



answered Oct 22, 2021 by avibootz

Related questions

1 answer 157 views
1 answer 195 views
2 answers 242 views
1 answer 143 views
...