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 trialDante Ortiz
3,844 PointsHere is my solution.
I will appreciate any constructive feedback to clean my code and make it better. Thank you!
1 Answer
Steven Parker
229,644 PointsYou're doing great as-is, but you don't need any arguments on the "color" function. Just create the variables internally (with "var" or "const").
You can also make it a bit more compact if you create a second function to pick a random number. Then you can eliminate the variables completely and just call that function three times when you build the rgb string.