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?
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?
Be sure to use backticks on the template literal.
Thanks. The backticks took care of it.