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
bobcat
13,623 PointsNot sure if my code is right? I am using CodePen to make all examples, but it doesn't give me any response on console?
function randomNumber( lower, upper ){
if ( isNaN (lower) || isNaN (upper) ){
throw new Error('Nope');
}
return Math.floor( Math.random() * ( upper - lower + 1 ) ) + lower;
}
console.log( randomNumber(1,'ten') );
console.log( randomNumber('three',47) );
console.log( randomNumber(1,47) );
1 Answer
Steven Parker
243,656 PointsTry using the console in your browser's developer tools.
The "console" of Codepen is fine for logged messages, but it won't handle thrown exceptions. But they should show up in your browser's console.