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 trialScott Seward
Courses Plus Student 1,524 PointsChallenge Task 1 of 2 for Giving Information to Functions
Good evening, I am trying to create a max() Function with two arguments. The exercise states that I need to create an IF statement to test which number is the larger of the two arguments. I have tried several times to create an IF statement that will allow me to do this with no success. I create a function at the top of the program and then I write my IF statements outside of the function. Do i need an IF ELSE statement and not just an IF statement? Do I need to display an alert message saying which number is (or isn't) the max? I keep getting syntax errors every time I try to run my program.
1 Answer
Seth Kroger
56,414 PointsSharing you code will help a lot. However I will give you the hint that the if statement needs to go inside the function, not outside it.