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 JavaScript Basics (Retired) Working With Numbers The Random Challenge

My Solution - feedback welcome

Hi all, just completed this task after scratching my head for a bit. Anyway I could clean it up better or use fewer lines of code?

https://w.trhou.se/aqfl9qy6de

6 Answers

It's working. Looks more correct

Thank you so much for taking the time to put me straight!

Your link doesn't work

Sorry, I dont know whats going on tbh. The link works on my laptop, my PC and my phone

It's says page doesn't exist. maybe it exists only locally on your computer

Ok here goes part 2 - https://w.trhou.se/azo44y9wak

Why did you put an argument inside Math.random()?

Math.random(number)????

I thought that was the correct syntax, am I horrifically incorrect? ^^;

Normally you don't put anything inside the parentheses in Math.random()

Thank you for that does this look much better?

https://w.trhou.se/aqfl9qy6de

As you proceed through the course you'll understand yourself how you can improve the same code.