I'm trying to write some code so that when the user clicks a button, the page writes the numbers 1 through 125, while modifying some in between My first question is how do I write the conde so that the function writes these numbers. Here's the code I have so far.
<script>
function randomNumber() {
var num = Math.floor(Math.random() * 125);
for (var i = 0; i < 125; i++) {
document.write(num);
}
</script>
My second question is how do I modify each a few of the numbers to read, for example, ten instead of 10. I assume that this will use a nested for loop, unless I'm wrong. Any help would be great! Thank you.