Build a Mathbot - Step 1

Tell us what’s happening:

Hi, why won’t the code pass? I’m using template strings and interpolation

Your code so far


// User Editable Region

let botName = "MathBot"
let greeting = "Hi there! My name is `${botName}` and I am here to teach you about the Math object!"

console.log(greeting)

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36

Challenge Information:

Build a Mathbot - Step 1

Hi there,

Your code currently outputs:

Hi there! My name is ${botName} and I am here to teach you about the Math object!

But what’s expected is:

Hi there! My name is MathBot and I am here to teach you about the Math object!

The issue is that you’re using backticks inside double quotes, which prevents the variable from being evaluated. You should remove the double quotes and wrap the entire string in backticks instead.

1 Like