Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
3

SyntaxError: Unexpected token (38:2)

gozalsabirova
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

3 years ago
Answered by PYerView Answer

Voters

Comments

TopNew
1
PYer
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!

3 years ago
1
AphixDev
AphixDev

@PYer
A pro has arrived xD

3 years ago
1
PYer
PYer

I'm better at python than js...

@nt998302

3 years ago
1
AphixDev
AphixDev

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

3 years ago
1
PYer
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

3 years ago
1
AphixDev
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

3 years ago
1
gozalsabirova
gozalsabirova

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

@PYer

3 years ago
1

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

3 years ago
1
AphixDev
AphixDev

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

3 years ago
1
AphixDev
AphixDev

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

3 years ago
Load more