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 trial

JavaScript JavaScript Functions Pass Information Into Functions Create a max() Function

Ok I'm not sure how this function argument should be. Please give me some help?

script.js
function max (mob22, mob215) {
  if (mob22 > mob15) {
  return mob22;
 } else {
  return mob15;
 }
}
console.log( max(22, 15) );

3 Answers

Hey man, you got very close, you just mistyped your parameters in line 2, you have parameter mob215, but you call mob15

:)

function max (numberOne, numberTwo) { if (numberOne > numberTwo) { return numberOne; } else { return numberTwo; } };

Thank you Ian, and its funny how your eyes can play tricks on you. I'll make sure to read over my code slowly to catch details.

Mark Sebeck
Mark Sebeck
Treehouse Moderator 38,004 Points

Alonzo, sometimes its good to step away from the code for a little while and when you come back sometimes the little typos jump right out at you. Keep working at it!

Appreciate that advice Mark. I'm going to keep working at it!