To print the numbers from 1 to 100 in TypeScript, you can use a for loop.
index.ts53 chars4 lines
In this code, we use the for loop to iterate through the numbers from 1 to 100. We initialize a variable i to 1 and increment it by 1 each time the loop runs. We continue the loop as long as i is less than or equal to 100. Within the loop, we use the console.log() function to print each number to the console.
This will output the numbers 1 to 100 in the console:
index.ts20 chars8 lines
gistlibby LogSnag