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 trialDan Spector
1,979 PointsNot sure why this function isn't returning correctly?
I know the numberOne and numberTwo parameters (is that what these are called?) aren't being identified correctly, but I'm not sure what I'm doing wrong? I'm sure it's a simple syntactical error, I just can't figure it out!
function max(numberOne,NumberTwo) {
if (numberOne > numberTwo) {
return numberOne;
}
else {
return numberTwo;
}
}
2 Answers
Tony Nguyen
24,934 PointsHey, what's up.
Yeah, it's a syntactic error. Check your code again and check your capitalization for your arguments. Keep in mind that capitalization matters for your arguments.
Dan Spector
1,979 PointsThanks guys!
Andy Simmons
Courses Plus Student 3,734 PointsAndy Simmons
Courses Plus Student 3,734 PointsNames of things in Javascript, in your case parameters, are case sensitive.
In the first line you declare a parameter called NumberTwo but inside the function you are trying to work with a local variable called numberTwo, which your function doesn't know anything about.