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 trialAngelica Islas
4,082 PointsCompleting the code with the parameters greeting and name
const sayGreeting = => {
return ${greeting}, ${name}.
;
}
I thought that inserting closed parenthesis () before the arrow would solve this, but I was wrong. Could I have some assistance? Thank you
1 Answer
Peter Vann
36,427 PointsHi Angelica!
The giveaway is the fact that you are referencing two variables in the body of the function.
Where did they come from?
They need to be passed in.
Like this:
const sayGreeting = (greeting, name) => {
return `${greeting}, ${name}.`;
}
And , of course in the real world, you would then call the function something like:
const myGreeting = sayGreeting("Yo", "Angelica");
I hope that helps.
Stay safe and happy coding!
Angelica Islas
4,082 PointsAngelica Islas
4,082 PointsThank you for your help!