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 Arrow Functions JavaScript Functions Review

i think i need to review this lesson, forgot what to do .

In the function below, set the default value of the partOfDay parameter to 'morning'.

function greet( name, partOfDay

Jan Su
Jan Su
3,943 Points

function greet( name, partOfDay = 'morning' ) { return Good ${partOfDay}, ${name}!; }

1 Answer

Peter Danville, Jr
Peter Danville, Jr
3,198 Points

It should be written as such:

function greet( name, partOfDay = 'morning')