typescript for array code example
Example 1: 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...
}
Example 2: type script array
let list: number[] = [1, 2, 3];
Example 3: typescript list
enum Color {
Red = "red",
Green = 2,
Blue = 4,
}
let c: Color = Color.Green;Try