6. Asking for feedback


#1



SyntaxError: Unterminated template literal


if (feedback > 8)
{
    console.log("Thank you! We should race at the next concert!");
}
else
{
    console.log("I'll keep practicing coding and racing.");
}


#2

@glazer13,
In your IF ELSE
you should use the EXACT text's as are mentioned in the Instructions....


#3

It is


#4

@glazer13,
Please..
Could you provide the code as text...??


#5

@glazer13: looks like you are missing semicolon's at the end of your if/else console.log statements based on the screen shot.


#6

//I'm kinda lost . What am I doing wrong here??

var age = prompt("whats your age?");
if(age < 13)
{
console.log("you can not enter this site");
}
else
{
console.log("welcome user, you are old enough");
}
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");
console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'");
var quest = prompt("do you want to race Justin Bieber on stage?");
if(quest === "yes");
{
console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!");
}
else
{
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}
var feedback = prompt("please rate the game 0-10");
if(feedback < 8)
{
console.log("I'll keep practicing coding and racing");
}
else
{
console.log("Thank you! We should race at the next concert!");
}
*unexpected token else


#7

@tacinamo
For the Javascript Interpreter a semi-colon-; is an End-of-Statement indicator.

Thus if you write
if ( _condition_);
the IF statement is seen as been Ended
and a following ELSE statement is not expected.


#8

Right! I dig it now.

Thanks leonhard.wettengmx.n, it works like a charm!


#9

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