VARIABLES String Interpolation II


#1

I am not sure why my code is not working. Can you please look it over and let me know what i am doing wrong?

let myName = 'Michael';
let myCity = 'Los Angeles';
console.log('My name is ${myName}. My favorite city is ${myCity}.`);

Create a variable called myName and assign it your name.

Create a variable called myCity, and assign it your favorite city’s name.

Use ${} to interpolate your variables into the sentence below. Use console.log() to print your sentence to the console.

My name is NAME. My favorite city is CITY.
Replace NAME and CITY in the values above with the values saved to myName and myCity.


#2

for string interpolation to work, the string needs to be enclosed in grave accent/backticks (`)


#3

So, what would be the correct code? Is there any way that you could type what the correct code is? I am somewhat confused. Thank you


#4

exercises have a get solution buttons these days, so if you are just interested in the solution, i highly recommend that button. This button appears after several failed attempts

look at your string:

console.log('My name is ${myName}. My favorite city is ${myCity}.`);

you use apostrophe at the start of your string, and backtick at the end. This doesn’t even match, which one should it be?