let myName = ‘Allison’;
let myCity = ‘Los Angeles’;
console.log (My name is ${myName}. My city is ${myCity}.
);
IT PRINTED OUT CORRECTLY. I DID THE BACK TICS, AND I DID CURLY BRACKETS.
BUT IT STILL SAYS I DIDN’T DO IT RIGHT. It Says, did you interpolate myName and myCity with back tics and curly brackets. Well, I did. I’ve tried this over and over. thank you!
3 Likes
oh, the back tics don’t show up on this clipboard copy. That’s weird. I can see the back tics on my lesson screen where I typed them. It’s the back tic symbol on the key to the left of the 1 key. This is weird. Any thoughts appreciated.
1 Like
let myName = ‘Allison’;
let myCity = ‘Los Angeles’;
console.log (`My name is {myName}. My city is {myCity}.``);
This says did you interpolate using back tics and curly brackets. But I did! And it printed correctly. But it won’t let me advance to “next” lesson
Not sue what your problem might be with your code. Try posting it with 3 back tics on the line above your code, and 3 more back tics on the line below. It will cause it to look like this:
let myName = 'Allison';
let myCity = 'Los Angeles';
console.log(`My name is ${myName}. My city is ${myCity}`);
Actually, I just looked at the lesson. It seems the reason your code isn’t passing is the sentence you logged. The lesson asks for a specific output:
3. Use a single template literal to interpolate your variables into the sentence below. Use console.log()
to print your sentence to the console in the following format:
My name is NAME. My favorite city is CITY.
Replace NAME
and CITY
in the string above by interpolating the values saved to myName
and myCity
.
Looks like you forgot the word ‘favorite.’ 
1 Like
Ah. Well. I thank you very kindly!!!
I’m trying to learn this at age over 50.
I looked up to old to code and people 19 years old were wondering if they were too old.
Well, I’ll be more careful. And thanks again!!!
1 Like
wait. Replace NAME
and CITY
in the string above by interpolating the values saved to myName
and myCity
. It did not say to use 'favorite." That was the animal project. The city doesn’t.
ugh. I’ll try the 3 back ticks you metioned.
I’m not quite 50, but close. I first learned to code in High School many years ago. I don’t write code for a living, but I do write code to make my job easier, and as a hobby. You’ll find some of these lessons are very particular with the output they are expecting. Good luck && Happy Coding!
Wow, it did ask for “favorite.” okay. i passed. thank you again!!!
1 Like