Syntax error: unterminated string contsant


#1


https://www.codecademy.com/en/courses/javascript-beginner-en-x9DnD/0/3?curriculum_id=506324b3a7dffd00020bf661


It says
Syntax error: Unterminated string constant

I'm not sure what I'm doing wrong here.. Any help would be much appreciated!


confirm("I am ready to play!");
var age = "age";
var age = prompt("What's your age?");
if ("age" <= 13) {
    console.log("You are allowed to play, but we take no responsibility.");
} else {
    console.log("Go on and play!);
    }
console.log("You are at a Justin Beiber concert, and you hear this lyric 'Lace my shoes off, start racing.'");


#2

SyntaxError: unterminated string literal

from mdn:
What went wrong?
To fix this error, check if:

  • you have opening and closing quotes (single or double) for your string literal,

  • you have escaped your string literal correctly,

  • your string literal works correctly over multiple lines, if any.


#4

Thank you so much for trying to help! The error was caused because I spelled Bieber wrong (oops..).


#5

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