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 Basics (Retired) Creating Reusable Code with Functions Create a max() Function

I'm really struggling with JavaScript. I didn't keep a record of the coding. I can't get past the function max quiz.

I tried downloading the workspaces to keep track, but they aren't openable, apparently. I'm completely lost and can't go forward in my track.

script.js
function max (width, height) {
  return max ( larger );
  if {

  }
}
Cheo R
Cheo R
37,150 Points

Reading the first challenge, it just wants you to return which of the two numbers is larger. so

function max(first_number, second_number){
    if (first_number > second_number){
        return first_number;
   } else {
       return second_number;
  }
}

1 Answer

Thank you for your help. I'm never going to not record again. I really don't understand JavaScript, and my only hope of getting through this block is to copy the code as I go so I can go back to it.

Justin Goldby
seal-mask
.a{fill-rule:evenodd;}techdegree
Justin Goldby
Full Stack JavaScript Techdegree Student 12,754 Points

You're not alone! It takes time, dont rush yourself. I have been learning it for about 2 years now and I still struggle with some of the basics!

Cheo R
Cheo R
37,150 Points

No worries. I'm still not fully understanding what's going on sometimes. It's ok to watch lectures over again.