Please post your actual code instead of a screenshot. Also, please talk to us about how you need help. Thanks
function pick(guess) {
const numbers = [];
while (numbers.length < 10) {
numbers.push(randomNumber);
const randomNumber = Math.floor(Math.random() * 11) + 1;
}
}
i dont get to see wat wrong am doing kindly help
Ok. What’s happening? What’s supposed to be happening? What debugging have you tried?
Inside your while
loop, push a random number between 0
and 10
to the end of the numbers
array. You can create this random number with Math.floor(Math.random() * 11)
.
this is wat should be happening sir
You can’t use randomNumber
before its declaration.
If this is a challenge step please post the link to it.
Ok, what debugging have you tried?
correction from chat gpt still nohelp
there is no changes yet but that was a good one
hadn’t seen that
function pick(guess) {
const numbers = ;
while (numbers.length < 10) {
const randomNumber = Math.floor(Math.random() * 11);
numbers.push(Math.floor(Math.random() * 11));
}
}
i just had to re-write the code inside the push
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.