Console.log ('Hi, ${blahblah}' Not printing as expected

When I try to print out a stored variable, for example
let userName = ‘Mike’;
console.log (‘Hi, ${userName}’);

I expect, “Hi, Mike” but get "Hi ${userName}’

I can’t figure out what I am doing wrong. Can anyone help?

(https://www.codecademy.com/journeys/full-stack-engineer/paths/fscj-22-building-interactive-websites/tracks/fscj-22-javascript-syntax-part-i/modules/wdcp-22-learn-javascript-syntax-conditionals-0e12e9e0-b36f-476e-b10c-afbc7cd6dbfe/projects/magic-eight-ball-1)

Be sure to use backticks on the template literal.

3 Likes

Thanks. The backticks took care of it.

1 Like