You can use a for loop to loop from 1 to 10 in JavaScript:
index.tsx52 chars4 lines
This loop will start at 1, and continue looping as long as i is less than or equal to 10. On each iteration of the loop, the code inside the braces will be executed. In this case, we're simply logging the value of i to the console.
So when you run this code, you should see the numbers 1 through 10 printed to the console.
gistlibby LogSnag