Help!
function pick(guess) {
const numbers = [];
while (numbers.length < 10) {
numbers.push(Math.floor(Math.random() * 11));
}
text.innerText = "You picked " + guess + ". Here are the random numbers:\n";
for (let i = 0; i < 10; i++) {
text.innerText += numbers[i] '\n';
}
}
1 Like
Teller
2
Hi @victorakinyemi52
If you want to add the new line character, you need to concatenate it.
Happy coding
2 Likes
function pick(guess) {
const numbers = [];
while (numbers.length < 10) {
numbers.push(Math.floor(Math.random() * 11));
}
text.innerText = "You picked " + guess + ". Here are the random numbers:\n";
for (let i = 0; i < 10; i++) {
text.innerText += numbers[i] + "\n";
}
}
system
Closed
4
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.