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 trialTina Maddox
28,102 PointsHello Treehouse, I would appreciate some 'fresh eyes' to look at my code. I cannot figure out what I am missing.
I am sorry for the repeated question as it has been asked
I have searched the forum, and implemented the solutions I found but they are not working either.
Thank you in advance for your help.
function max (num1, num2) {
if (num1 > num2) {
return num1;
} else {
return num2;
}
}
alert (Math.random (max));
3 Answers
Ken Alger
Treehouse TeacherTina;
You are passing in a variable, not the max()
function into the Math.random()
method. Try that minor typing change, which results in a major program change, and see it if helps.
Ken
Tina Maddox
28,102 PointsOh my goodness, Ken!
I finally got it! After five days!!!!!
Thank you SO MUCH! =D
Tina
Ken Alger
Treehouse TeacherTina;
Way to stick with it! Sometimes it just takes another pair of eyes.
Happy coding.
Ken