Using $ to make something an object in a text string

When I attempt to use [$] to embed a variable inside of a console.log text string, it doesn’t change to a variable, but simply prints the name of the variable.

let userName = ‘Dennis’;
userName ? console.log(‘Hello, ${userName}!’) : console.log(‘Hello!’);

This prints Hello, ${userName}! Rather than Hello, Dennis!

I can’t figure out what I’m doing wrong??? Any help for this extreme newbie appreciated.

Dennis - Win10, latest Chrome

To preserve code formatting in forum posts, see: [How to] Format code in posts

I think you used quotes instead of backticks. Template literals use backticks.

// I think you used quote('):
console.log('Hello, ${userName}!')

// instead of backtick(`):
console.log(`Hello, ${userName}!`)

Yes Sir!!! That was it! Thank you SO much mtrtmk… :star_struck: