So I am at the beginning of the Magic Eight Ball JavaScript and I am failing to see why what I have typed is not reading correctly.
This is on step 2: " create a ternary expression that decides what to do if the user enters a name or not. If the user enters a name — like 'Jane'
— use string interpolation to log Hello, Jane!
to the console. Otherwise, simply log Hello!
."
Here is what I have typed:
let userName = ‘Jane’;
userName ? console.log (‘Hello, ${userName}!’) : console.log(‘Hello!’);
When I save it prints: “Hello, ${userName}!” instead of the expected “Hello, Jane!”
I looked at the video and the hint and it is identical:
userName ? console.log(
Hello, ${userName}!
) : console.log(‘Hello!’);
Is this an error on the system’s part or am I missing something in my code? I am not seeing the difference when I compare what I type and what I can copy/paste from the hint. (Just want to be sure I’m not missing something on my part in my learning process.) Thanks!
EDIT: The same is happening when I try to go into the next steps writing:
const userQuestion = ‘Will I pass my test?’;
console.log(‘${userName}, you asked ${userQuestion}’)