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 trialSusanna Clough
Full Stack JavaScript Techdegree Student 1,678 PointsIt looks correct to me! Please help!
The message "make sure to pass 'greet' a string" keeps coming up. My code looks identical to the hints and to my notes.
const greet = ('cool coders') => {
};
function greet(val) {
return `Hi, ${val}!`;
}
3 Answers
Rabin Gharti Magar
Front End Web Development Techdegree Graduate 20,928 PointsHey Susanna Clough,
The code you have written is incorrect
because you are trying to convert a call greet('cool coders')
into arrow function.
Try the following code:
Here, I have converted function declaration
into arrow function
and then called by its name.
const greet = val => {
return `Hi, ${val}!`;
};
greet('cool coders');
Hope this helps!!
Adam N
70,280 PointsI recommend clicking the restart button and trying again. In this challenge, you should be converting the function declaration into an arrow function. You converted the function call into one instead.
Let me know if this helps!
Susanna Clough
Full Stack JavaScript Techdegree Student 1,678 PointsThank you so much for your help!!
Rabin Gharti Magar
Front End Web Development Techdegree Graduate 20,928 PointsArrow function are not hoisted like function declaration therefore it needs to be called after it's been defined.
Adam N
70,280 PointsAdam N
70,280 PointsWhy is the function call at the bottom of the file? :)
Susanna Clough
Full Stack JavaScript Techdegree Student 1,678 PointsSusanna Clough
Full Stack JavaScript Techdegree Student 1,678 PointsThank you so much for your help!! I was so frustrated and your explanation really helped me!!