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 trialBen Brenton
266 PointsCode Challenge: Not sure how to proceed.
Having been given this code challenge, I'm not quite sure how to proceed. My instinct, and taking the hint from the title of the function, is to incoorporate the Math.max function into the code, but the task laid out seems to suggest that you should use conditional statements to find the higher number of the two. Can someone give me some help along those lines?
1 Answer
Russ Fleharty
Python Web Development Techdegree Student 10,815 Pointsfunction max(num1, num2 ) { //you can name them whatever you'd like 1,2 is fine too
if (num1 > num2) {
return num1;
} else {
return num2;
}
}
max(alert(Math.random()));
Good luck :)
Ben Brenton
266 PointsBen Brenton
266 PointsThis comes up with the same error I have been hit with, syntax. Back to square one