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 trialMax Peterson
1,723 PointsI can't get interpolation to work. I typed it out like in the video, but when I refreshed the page, nothing appeared.
nothing appears in the interpolation slot in the template literals tab even though I have typed it out exactly like in the video. what's going on?
Michael Hulet
47,913 PointsCan you paste the code you're having trouble with here? It'd help us a lot if we could see your code and try it ourselves
3 Answers
KRIS NIKOLAISEN
54,971 PointsYou are missing a few backticks
function like(thing) { return 'I like ' + thing; }
function love(thing) { return `I love ${thing}` ; } //after ${thing} here
const sentence = `<p>${like('apples')}, but ${ love('oranges')}.</p>`; //before <p> and after </p> here
document.querySelector('.interpolation').innerHTML = sentence;
Max Peterson
1,723 Pointshere it is.
function like(thing) { return 'I like ' + thing; }
function love(thing) { return `I love ${thing} ; }
const sentence = <p>${like('apples')}, but ${ love('oranges')}.</p>
;
document.querySelector('.interpolation').innerHTML = sentence;
I tried to make it exactly like the teacher showed in the video, and I'm pretty sure it is exactly the same. But for some reason it didn't work when I viewed it. Thank you for responding.
Max Peterson
1,723 PointsThanks. I hadn't noticed that.
KRIS NIKOLAISEN
54,971 PointsKRIS NIKOLAISEN
54,971 PointsWhat does the console say?