Syntax error: unterminated string contsant


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.'");


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.


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


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