Skip to content
← Back to Community
SyntaxError: Unexpected token (38:2)
Profile icon
gozalsabirova

I keep getting an error message when I try to run this. I've toyed around with the code, but can't seem to figure out the problem. Any ideas what's wrong?
Screen Shot 2020-04-24 at 12.13.47 PM
Screen Shot 2020-04-24 at 12.13.31 PM

Answered by PYer [earned 5 cycles]
View Answer
Voters
Profile icon
AfrazHameed
Profile icon
MiemniiSkamier
Profile icon
gozalsabirova
Comments
hotnewtop
Profile icon
PYer

Hello @gozalsabirova! Next time you ask a question, it would be more helpful to link the repl rather than share screenshots, but to answer your question:
The problem is that you have no value in between the braces. Therefore, the waits for a variable to be passed, and then unexpectedly stumbles across the ending brace (}). Therefore, it raises an error pointing it out. To fix it, you should include the variables you want to print inbetween the braces, as shown below:

console.log(`This is what I'm wearing today: ${torsoClothing} on my torso ${legClothing} on my legs ${footWear} on my sneakers `)

Please mark this as the answer if it helps! Thank you!

Profile icon
AphixDev

@PYer A pro has arrived xD

Profile icon
PYer

I'm better at python than js... @nt998302

Profile icon
AphixDev

@PYer Then I'm like you except I don't know js :P

Profile icon
PYer

Lol. I have a very limited knowledge, I guessed at the error first, but then had to go research it more just to check. @nt998302

Profile icon
AphixDev

@PYer I see.

Profile icon
AphixDev

@PYer I tried javascript one summer and to this day I still don't like it and don't have a clue as to how to do it xD

Profile icon
gozalsabirova

thank you!!! it worked. much appreciated :) @PYer

Profile icon
[deleted]

You need a semicolon at the end of each line (not the if or else if statements).

Profile icon
AphixDev

Okay. I believe you need a semicolon after many lines.

Profile icon
AphixDev

@gozalsabirova Just look at @PYer 's answer. He's good.

Profile icon
AphixDev

What lang?

Profile icon
gozalsabirova

Javascript @nt998302