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 Object-Oriented JavaScript (2015) Introduction to Methods Understanding this

Hello, When I assign dice.sides to 3, It happens that I get some randomNumber values greater that 3.

When I assign dice.sides to 3, It happens that I get some randomNumber values greater that 3. It is not normal, right ?

rydavim
rydavim
18,814 Points

Welcome to Treehouse!

It's really going to depend on how you're doing this in your code. Can you post your code here or use a workspace snapshot? Then we should be able to help troubleshoot your problem.

2 Answers

Ram P
Ram P
4,149 Points

Yes. That is not normal and a clear indication something went wrong. If you have assigned it from the console it should be

dice.sides = 3 or dice10.sides = 3.

Valentin Fezza
Valentin Fezza
18,178 Points

Hi Emmanuel,

Have you saved your new .js file and refreshed the preview window?

All the best!