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 trialvwarner
1,583 PointsWhy getRandom(12); is incorrect?
Complete the code below to call the function and pass the value 12 to it: function getRandom( upper ) { return Math.floor(Math.random() * upper) + 1; }
//What's the answer? Isn't it getRandom(12); Treehouse says that's wrong.
6 Answers
Clayton Perszyk
Treehouse Moderator 48,850 PointsIf you're adding a semi-colon to your answer, remove it. There's already one provided
maximleguennec
Full Stack JavaScript Techdegree Student 4,777 Pointsi have the same question, i don't understand, i'm typing
getRandom (12);
and its wrong !
Chris Hall
Full Stack JavaScript Techdegree Student 11,442 PointsThe quiz wants, getRansom(12). So no spaces.
M W
3,446 PointsFrustrating when it isn't obvious that the semicolon was provided - not to my old eyes anyway. Waste time looking for alternate answers when the correct one was typed in originally. Would be useful if the program could highlight it when it is just something like this. :)
maximleguennec
Full Stack JavaScript Techdegree Student 4,777 Pointsahhhhh okay.... understoood
LeighAnne Turner
5,243 PointsgetRandom(12).
Steve Fan
8,218 PointsOmg what kind of tricky, i was being stuck with this question for a while =.= Tks vwaner for posting this question before. It saves my time.
vwarner
1,583 Pointsvwarner
1,583 Pointsthat was it! My fault