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 trialNour El-din El-helw
8,241 Pointsplz check my code
is there something wrong with my code??? https://w.trhou.se/wi8q3pvyha
Nour El-din El-helw
8,241 PointsThat's what i get : Uncaught Error : check if all arguments are numbers random.js:3 at getRandomNumber (random.js:3) at random.js:9
1 Answer
Robert Anthony
19,952 PointsIt is doing exactly what you asked it to do. If one of the parameters is not a number then you throw an error saying "check if all arguments are numbers".
You are getting an uncaught error message because you throw this message but don't catch it.
If you put the code in a try catch block you will avoid this but it depends what the challenge is to do.
Robert Anthony
19,952 PointsRobert Anthony
19,952 PointsAre you getting an error? If so, what does it say?