## 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.

# Throw new Error(); not showing error, but shows syntax error in console.

Cannot figure out what is going wrong here. Hope someone can enlighten me. The specific problem seems to be with the 'throw new Error();' function.

random.js
```//
function randomNumber(upper, lower) {
var randomNum = Math.floor(Math.random() * (upper - lower + 1)) + lower;
return randomNum;
}

// Getting the users numbers
var lowerNum = prompt("Pick a number");
var upperNum = prompt("Pick a larger number");
var int1 = parseInt(lowerNum);
var int2 = parseInt(upperNum);

// Checking they gave number digits
var num1 = isNaN(int1);
var num2 = isNaN(int2);

// throwing error if missing number digits
if ( num1 === true || num2 === true ) {
throw new Error("You need to use number digits like 1 2 3");
}

document.write(randomNumber(int1, int2) + " is a random number between your choices.");
```

I think I may have misunderstood what this function does. I wanted to let the user know they had not given me a usable number. Still not entirely sure how I would use 'throw new Error();', so any help would be appreciated.