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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Autumn Rhodes](https://secure.gravatar.com/avatar/77c08dd4b3350bbb4eaf62e9d2463b82?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Autumn Rhodes
925 PointsArrow function example nets me a depreciated warning.
I was testing the various examples on this lesson, but when I submitted
const name = prompt(What's your name?
);
const greet = () => alert(Hello, ${name}
);
I found that while the prompt went off, the alert did not. I tested this in my playcode, and realized that the ${name} in the alert was listed as depreciated. Is there anything I can do, or is this something to do with my specific...is formatting the word to use?
2 Answers
![Phil Wright](https://uploads.teamtreehouse.com/production/profile-photos/510552/micro_phil_wright_p50_headshot_mono_contrast_cropped.jpg)
Phil Wright
3,654 PointsHey Autumn
There is a bit of tidying up needed on your strings and string interpolation so you don't get any errors.
I've added an extra bit here too so that your greet variable (which has the arrow function assigned to it) gets invoked.
For visibility of what is being used where I’ve changed the variable name and the parameter for the arrow function.
So the first line assigns the prompted value to promptedName, then this variable is passed as an argument when greet is invoked and used to populate the template literal.
const promptedName = prompt("What's your name?");
const greet = (nameParameter) => alert(`Hello, ${nameParameter}`);
greet(promptedName);
![jacknoren](https://uploads.teamtreehouse.com/production/profile-photos/120259/micro_Mike_The_Frog.jpg)
jacknoren
24,134 Pointsconst name = prompt(`What's your name?`);
const greet = (nameParameter) => alert(`Hello, ${nameParameter}`);
greet(promptedName);
There were a few things wrong with your code. I would recommend going over the videos again and following along. I went ahead and posted the answer for you so you can get an idea how to do it.
Autumn Rhodes
925 PointsAutumn Rhodes
925 PointsPerfection, that answers my question very nicely. Thank you!