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 trialAllison Kuehn
10,772 PointsReally struggling with this one, any guidance would be appreciated.
I set it up as a conditional statement, but have no idea what to put in the block code for the "if" and "else" statements.
function max (5,10) {
if {
5=false;
} else {
10=true;
}
}
max();
1 Answer
john larson
16,594 Pointsfunction max(a, b){
if(a>b){
return a;
}else {
return b;
}
}
alert(max(5, 3));
Wesley Briney
4,254 PointsThank you for your answer I was stuck on this as well.
john larson
16,594 Pointsjohn larson
16,594 PointsIf this doesn't make sense let me know, I can go through it line by line. What you did was clever but It looks like you were mixing in a few different concepts. They all get jumbled together sometimes. It will become clearer.