let userName = ’ ';
userName? console.log(Hello, ${userName}.
)
:console.log(‘Hello!’);
const userQuestion = " How are you?";
console.log(Hello, ${userName} ${userQuestion}.
);
let randomNumber = Math.floor(Math.random()*8);
let eightBall = ’ ‘;
switch (randomNumber) {
case 0:
eightBall= ‘It is certain’;
break;
case 1:
eightBall= ‘It is decidedly so’;
break;
case 2:
eightBall = ‘Reply hazy try again’;
break;
case 3:
eightBall =‘Cannot predict now’;
break;
case 4:
eightBall = ‘Do not count on it’;
break;
case 5:
eightBall = ‘My sources say no’;
break;
case 6:
eightBall = ‘Outlook not so good’;
break;
case 7:
eightBall = ‘Signs point to yes’;
break;
}
console.log(‘The Magic 8 Ball says’ - ${eightBall}.’);
// bellow the error showes. Thanks
/home/ccuser/workspace/learn-javascript-U2P1/main.js:34
console.log(‘The Magic 8 Ball says’ - ${eightBall}.');
^
SyntaxError: missing ) after argument list
at wrapSafe (internal/modules/cjs/loader.js:1001:16)
at Module._compile (internal/modules/cjs/loader.js:1049:27)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
at internal/main/run_main_module.js:17:47