I know that is very simple, but why is the line break not working here and the numbers keep printing in a single line? I want to print 100 random numbers on a line and then again 100 random numbers, but on a new line.
function generateNumber() {
const arr = Array(100)
for (i = 0; i < arr.length; i++) {
setInterval(() => {
let randomNumber = (Math.floor(Math.random() * 10) + 1);
document.write(randomNumber + "\n")
}, 3000);
}
}
function test() {
generateNumber();
}
test();
` instead of `\n` to add a line break in HTML – Nick Parsons Oct 22 '22 at 10:12
it will print me into a column 100 numbers, i wanna like this one: 22323232323 /n 4650569568 – Michael V Oct 22 '22 at 10:20