I got stuck on the first part of the Magic Eight Ball project. This is the code I wrote:
let userName = ‘Jane’;
userName === ‘Jane’ ? console.log(Hello, ${userName}
) : console.log(‘Hello!’);
I don’t understand why there is an error. According to my understanding, if the username equals ‘Jane’, then it should print ‘Hello, Jane’. If the username said ‘John’, then it should print just a simple ‘Hello’. Once I changed the code to match the tutorial, the program worked. I don’t understand why mine doesn’t work either, shouldn’t both of them work?