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

# Are we looking to generate random numbers between the upper and lower numbers and including the upper and lower number?

I might be wrong but my understanding is we're looking to generate numbers "between" two values (an upper and lower number). If I designate an upper and lower number, say (100, 95), I was assuming I'd get 96,97,98, and 99. But the code also gives me 95 and 100 as well. How, can we modify the code to generate only the numbers between two values?

May bad. Here is the code:

function getRandomNumber( lower, upper ) {

return Math.floor(Math.random() * (upper - lower + 1)) + lower; }

console.log( getRandomNumber( 'nine', 24 ) );

console.log ( getRandomNumber( 95, 100 ) );

console.log( getRandomNumber( 200, 'five hundred' ) );

console.log( getRandomNumber( 1000, 20000 ) );

console.log( getRandomNumber( 50, 100 ) );

If you want some insight on how this line of code works, i suggest looking at this answer by Jason Anello https://teamtreehouse.com/community/mathfloor-mathrandom-max-min-1-min-explanation

```function getRandomNumber(lower, upper) {
return Math.floor(Math.random() * (upper - lower - 1)) + lower + 1;
}
console.log(getRandomNumber(95, 100));
```

```    return Math.floor(Math.random() * (upper - lower - 1)) + lower + 1;