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 trialAbbas Nowruzi
5,191 PointsCompletely confused by this question
I'm Completely confused. I have no idea what to do!
function () {
// ????
}
1 Answer
geoffrey
28,736 PointsThe exercise asks you to create a function called max that takes two parameters. Then, this function needs to return the biggest number of the two passed parameters. For this, you need a simple condition.
function max(n1,n2){
if(n1>n2){
return n1;
}else{
return n2;
}
}
Abbas Nowruzi
5,191 PointsAbbas Nowruzi
5,191 PointsIt was so simple. I don't know why I'm confused about this... Thank You so much Geoffrey, Surely appreciate your time and effort