I have this code that displays 100 random numbers, then adds a break for every 10 numbers. How would I ensure that these 100 random numbers do not have repeats? I know maybe there's something to do with more if statements?
Thanks, J
<!DOCTYPE html>
<html>
<h1><font color = "blue">Random Numbers and Breaks (for loops)</font></h1>
<p><font color="red">This will display 100 numbers and insert a break in 10-number intervals:</font></p>
<div id="demo"> </div>
<body>
<script>
var text= '';
var i = 0;
var counter = 0;
for (; i < 100; i++ , counter++) {
var numbers = Math.floor((Math.random() * 100) + 1);
text += numbers + " " + "<br>";
if (i % 10 === 9) {
text += "<br>";
}
}
document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>