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 Create an Arrow Function

I'm still stuck on this could someone please help

script.js
greet('cool coders');

function greet(val) {
  return `Hi, ${val}!`;
}
const greet = (val) => {
  return `Hi, ${val}!`;
}

greet('cool coders');

2 Answers

Cameron Childres
Cameron Childres
11,817 Points

Hi FRANKIE,

The code that you've added works perfectly, you just need to remove the code that was already supplied:

const greet = (val) => {
  return `Hi, ${val}!`;
}

greet('cool coders');

i got it thanks for the help

Not sure what you are trying to do. looks like you are calling the function twice in addition to defining the function after it has already been declared