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 trialJasper Kop
10,423 Pointswhen I program it my self I don't get the regular error.I do see the text Both arguments must be numbers.
function randomnr(lower=3, upper=5) { if( isNaN(lower) || isNaN(upper)){ console.log('Both arguments must be numbers.');} return Math.floor(Math.random() * (upper - lower + 1)) + lower; }
// Call the function and pass it different values
console.log(randomnr(1,'six'));
console.log(${randomnr(10,100)} is a random number between two numbers
);
console.log(randomnr(200,500));
console.log(randomnr(5,7));
console.log(randomnr());
2 Answers
Steven Parker
231,248 PointsThe message will look different when using "console.log" (as shown above) instead of "throw" (as done in the video).
So it sounds like what you see is correct given the changes you have made in the code.
Jasper Kop
10,423 PointsThanks!!! I totally missed this part