String Interpolation II: Why didn't this work?


Error message:
Did you interpolate your name and favorite city using ES6 string interpolation?

The code:
var myName = “Bob”;
var myCity = “Bobland”;

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

If I change the log to this, it works: “My name is Bob. My favorite city is Bobland.”


Hi @digitalmaster53691,

Your console.log must be using ES6 string interpolation.

Use the backticks (`) to wrap the entire string instead of quotation marks " "

Hope it helps. :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.