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 Basics (Retired) Creating Reusable Code with Functions Random Number Challenge, Part II Solution

Shifat Kabir
Shifat Kabir
5,443 Points

Why line #3 showing an error?

https://w.trhou.se/qczp99up71 Why line #3 is also showing an error message?

"Console showing that message" Uncaught Error: Both arguments must be numbers at getRandomNumber (random.js:3) at random.js:8

1 Answer

Because you are throwing an error. If there was a catch statement that could handle the error then you wouldn't see it.