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 trialAndrew Alvarez
11,964 PointsWhat am I doing wrong?
Challenge Task 1 of 2
Create a new function named max() which accepts two numbers as arguments. The function should return the larger of the two numbers. You'll need to use a conditional statement to test the 2 numbers to see which is the larger of the two. Bummer! There was an error with your code: SyntaxError: Parse error
what am i coding wrong?
function getArea(width, length) {
var area = width * length
return area " " + unit;
}
console.log(getArea(10, 20));
1 Answer
Chi-Shiang Wang
3,471 Pointsin your code, there have a little bug in your "return area " " + unit " > return area " " + unit -> return area + " " + unit Please try it, maybe is work for you :-)
hoping this comment can help you solve your problem.
Chi-Shiang Wang
3,471 PointsChi-Shiang Wang
3,471 PointsHi, I'm not sure, but your code does't like to find maximum from two number. if your want to find large number from two number, you need "if" to help you.
And in your code, there have a little bug in your "return area " " + unit "
hoping this comment can help you solve your problem. <And.... sorry for my poor english>