SyntaxError: missing ) after argument list

Hi,

I’m getting the following error message ;

/home/ccuser/workspace/learn-javascript-U2P2/main.js:9
console.log("Your race starts at 9:30am and your race number is " , ${raceNumber})
^
SyntaxError: missing ) after argument list

Here’s my code:

let raceNumber = Math.floor(Math.random() * 1000);
let registeredRacer = true
let runnerAge = 25

if (runnerAge > 18 && registeredRacer === true);
  console.log(raceNumber + 1000)

if (runnerAge > 18 && registeredRacer === true)
console.log("Your race starts at 9:30am and your race number is " , ${raceNumber})

Hello, @taofeek93, and welcome to the forums.

You have a $ and { } around the variable name raceNumber. This suggests that you might be trying to use a template literal. Have a look at the documentation, and see if you can correct your syntax error.

1 Like