gistlib
One way to create an array from 1 to 100 in TypeScript is to use a for loop to iterate from 1 to 100 and push each number to an empty array. Here is an example code snippet:
index.tsconst arr: number[] = []; for(let i = 1; i <= 100; i++) { arr.push(i); } console.log(arr); // [1, 2, 3, ..., 100] 118 chars8 lines
const arr: number[] = []; for(let i = 1; i <= 100; i++) { arr.push(i); } console.log(arr); // [1, 2, 3, ..., 100]
gistlibby LogSnag