JavaScript Coding Issues


#1

I am working on String Interpolation. I tried to run this code.


However, it didn’t work, and it gave me the error message above.
What am I doing wrong?


#2

The '' are stray, as is the extra ,

`

#3

I deleted them and it still didn’t work.


#4

Please show us your raw code, and a link to the exercise. Thanks.


#5

Raw Code:
const myName = “jslade”;
const myCity = “Boston”;
console.log(`My name is ${myName}. My favorite city is ${myCity}.``);

Link:
https://www.codecademy.com/courses/learn-javascript-introduction/lessons/variables/exercises/string-interpolation-ii?action=resume_content_item&course_redirect=introduction-to-javascript&link_content_target=interstitial_undefined

Thanks!


#6

That double tick is an issue.


#7

The program won’t let me delete the double ticks.
I have no idea why.


#8

Never mind. It let me delete the double ticks. I don’t know why it wasn’t working before. Thanks!


#9

Can you paste in a new solution?

console.log(`My name is ${myName}. My favorite city is ${myCity}.`);

#10

Thanks for the new solution! The program let me delete the double ticks though after some persistance.
Thanks for the help!


#11

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.