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 trialMark Reitz
692 Pointswhat did I do wrong here?
What did I do wrong with the bottom line to call the function?
function getRandom( upper ) { return Math.floor(Math.random() * upper) + 1; } console.log(getRandom(12));
3 Answers
Steven Parker
231,236 PointsThe instructions ask you to "call the function and pass the value 12 to it", but they don't say anything about using "console.log" and don't expect to see it in the answer.
Mark Reitz
692 PointsThank you!
Ivelina Ventsislavova Stoilova
4,985 PointsHi! I put this code
'{ getRandom(12)}'
which apparently doesn't work. Can you advise?
Thanks!
Steven Parker
231,236 PointsI'm guessing you don't actually type in those single quotes, that would make the entire thing a literal string.
But you also don't need the braces. In actual code, they wouldn't be a problem but the quiz isn't expecting the answer to have them.
And in future, start a fresh question instead of asking one as an "answer" to an old question. That way more students will see your question and get a chance to respond.
Adam Beer
11,314 PointsAdam Beer
11,314 PointsCode
Wrap your code with 3 backticks (```) on the line before and after. If you specify the language after the first set of backticks, that'll help us with syntax highlighting.