The $ in the variables for Javascrit won't work

Hi
When I use $ in console.log () for Javascript, the console does not seem to recognise it.
When I tyoe
console.log(
“My name is $(myName). I am ${myAgeInDogYears} years old in dog years.”
);
Result
My name is $(myName). I am ${myAgeInDogYears} years old in dog years.

But when I copy the text from the Hint the result is correct
console.log(
My name is ${myName}. I am ${myAgeInDogYears} years old in dog years.
);

My name is ignasi vargas. I am 181 years old in dog years.

Am I doing something stupid?

Thanks

We can only use interpolation on the specially designed template literal which employs the backtick as the quote.

a = 10
b = 'binary'
console.log(`There are ${a} kinds of people who understand ${b}.`)
3 Likes