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 Functions Pass Information Into Functions Create a max() Function

can anyone please help with javascript functions task i

script.js
function max (

1 Answer

good start- remember the general structure of a function-

function max () {} firstly, remember to name your arguments within the function brackets ()

Remember your conditional statements- if () {} if (this condition is true) {then do this function}

you want to find out if firstNumber is bigger (>) than secondNumber before you return it so use the conditional statement to find that out Hope that helps and good luck!

thank you Na Wei

Just to let you know that is helping a lot thank you Na