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

parse error

The following code is giving me parse error

function max(20, 10) {
  if (20 > 10) {
    return 20;
} 
  else {
  return 10;
}
}

1 Answer

Hello Kingsley! Your code gives you parse error coz JavaScript interpreter can't parse your function declaration's parameters. If JavaScript could speak in english to humans , it'd say "I'm confused! And i cant understand any of this". Replace your "20" with variable "x" and "10" with "y" variable, coz our function need to be able to compare any two intergers, right? I hope it helped. (:

yeah right... was looking for a clear explanation as i already use C,B to solve the challenge