Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Loops Simplify Repetitive Tasks with Loops Create a while Loop

Clare Yeadon
Clare Yeadon
5,553 Points

Don’t forget to call

Good morning,

I keep getting the error “Don’t forget to call” & for the life of me I can’t see what I am doing wrong

script.js
function getRandomNumber(upper){
  return math.floor(Math.random()*upper)+1;
}

let count = 0;
while (count > 26){
  console.log( getRandomNumber(26) );
  count++;
}

1 Answer

Justin Horner
STAFF
Justin Horner
Treehouse Guest Teacher

Hello, Clare

You're close to getting this one! I see two issues.

First, you need to capitalize the M in Math.floor within the getRandomNumber function.

Second, your while condition needs to change so that the condition loops while the count is less than 26 (not greater than). The error states that console.log is not called because the while condition will always be false currently.

I hope this helps.

Clare Yeadon
Clare Yeadon
5,553 Points

Thank you! That did it!