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 trialolusoji ojerinde
2,048 Pointsmaxfunction
hi can you help look at the code. whats syntax error is wrong with it.
function max(30, 80) {
if max => 80;
return hot;
} else {
return cool;
}
function max(30, 80) {
if max => 80;
return hot;
} else {
return cool;
}
1 Answer
Steven Parker
231,269 PointsWhen defining a function, use named variables for the parameters.
You don't want to put the numbers in the definition.
Similarly, you will test the variables against each other and not a fixed value.