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 trialBenjamin Lowry
7,941 PointsIm sure it is a simple fix...
Can someone take a look at this for the code challenge and let me know what I'm doing wrong? I know I need a conditional statement but I guess I am not implementing it correctly?? Thanks!
function max (100, 200) {
if (100 > 200) {
return 100;
} else if (100 < 200) {
return 200;
}
}
1 Answer
Maxime Duhamel
7,169 PointsHi Benjamin, I think your problem is in the way you declare your function. You shouldn't have a white space between your function name and its arguments. function max(100, 200) <<<---
Otherwise if you think about your "else if" statement, it is not necessary. Else will be enough as you comparing only 2 values.
I hope it helps.
Max