Magic Eight Ball - String Interpolation Won't Work

I know it’s been asked before. But, in my case, I still can’t get string interpolation to work.

Here is my code:

let userName = 'Jane'
userName ? console.log('Hello, ${userName}'): console.log('Hello!'); // Output Hello, ${Username}

And, here is the link to the project

Any solution?

Thanks in advance!

1 Like


To use string interpolation you have to wrap the string in backticks ( ` ), instead of using the more traditional quotes.


Hi, there!

Now, I see where the issue is! I’ve been so desperate and missed this small detail. Thank you @notlyall for the help! Kudos!

1 Like