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 trialOlga Pokrovskaya
1,885 PointsGuys I read it all and keeps asking about interpolation but I did it! What is wrong?
const flavor = "Blueberry";
const type = "Smoothie";
const price = 4.99;
const drink = `${Blueberry} ${Smoothie}: $${4.99}`;
// This will render "Blueberry Smoothie: $4.99"
4 Answers
Peter Vann
36,427 PointsHi Jennifer!
Nice catch!
Not sure how I got that happened.
I guess I go back and forth between JS and Python questions so much that I got crossed-up!?!
Odd, really, given that I have already answered that question several times before.
I'll do my best to make sure it doesn't happen again, though, for sure.
Stay safe and happy coding!
Joseph Yhu
PHP Development Techdegree Graduate 48,638 PointsTry:
const drink = `${flavor} ${type}: $${price}`;
Olga Pokrovskaya
1,885 PointsThanks! I figured that, I mixed up the languages
Peter Vann
36,427 PointsHi Olga!
You aren't using the variables you created in the drink string.
(In other words, still use flavor, type, and price - don't change those, just the rest of the syntax, which you appear to be using correctly, so kudos on that!)
:)
Like this:
const drink = `${flavor} ${type}: $${price}`;
// This will render "Blueberry Smoothie: $4.99"
You can test Python challenge code here:
https://www.katacoda.com/courses/python/playground
Just add something like this to the end of the code:
print(drink)
...to actually see the drink string print out.
I hope that helps.
Stay safe and happy coding!
Jennifer Nordell
Treehouse TeacherHi there, Peter Vann! I'd like to point out that you're combining languages here. The question was for JavaScript so the first part is correct, but the second part, I'm pretty sure you meant to do a console.log(drink);
as opposed to a Python print(drink)
and instead point to a testing space for JavaScript
The first part will work in JavaScript but not Python and the second part will work in Python but not JavaScript.
Olga Pokrovskaya
1,885 PointsThanks a lot!
Olga Pokrovskaya
1,885 PointsThanks EVERYBODY! I figured that!!!! Just need one more try for the last module)