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 trialMaurice Hobbs Jr
5,278 Pointscan somebody help me find Syntax Error: Parse error?
it is the variable answer
function max( width, lenth){
var answer = if(length > width){
return length
}else if( length<width){
return width
}
return answer;
}
1 Answer
Steven Parker
231,236 PointsThis appears to be the fourth question on the same issue. But you still haven't applied one of the hints I left you on the first one. It was:
- you'll only need one inequality comparison for this task
And here's a few more:
- an "if" statement does not create a value that you can assign
- you don't need the variable "answer"
- you also won't need the third "return" after you remove the second conditional
You're pretty close now, I bet you'll get it this time.
Maurice Hobbs Jr
5,278 PointsMaurice Hobbs Jr
5,278 Pointsthank for the help the other questions were old but I didn't know how to delete them. I have completed using some of the tips u gave me and deleting a couple things
Steven Parker
231,236 PointsSteven Parker
231,236 PointsNo problem, the system will only let you delete a question that has no answers. But you can always edit a question or add comments to it instead of creating a duplicate.