Can someone help please what is the syntax error


#1

confirm("I understand confirm!");
var variable =age;
var age = prompt("What's your age");
if (age>13){console.log("dude your age is great but i take no responsibility!.")}
else {console.log("please continue")}
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 variable =userAnswer;
var userAnswer = prompt("Do you want to race Bieber on stage?")
if (userAnswer="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("give your feed back from 1-10")
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

i got it its:
confirm("I understand confirm!");
var variable =age;
var age = prompt("What's your age");
if (age>13){console.log("dude your age is great but i take no responsibility!.")}
else {console.log("please continue")}
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 variable =userAnswer;
var userAnswer = prompt("Do you want to race Bieber on stage?")
if (userAnswer="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("give your feed back from 1-10")
if (feedback=" >8"){console.log("Thank you! We should race at the next concert!")}
else {console.log("I'll keep practicing coding and racing.")}


#3

it still does not work!!!


#4

never mind...(:blush:


#5
confirm("I understand confirm!");

var variable = age;
var age = prompt("What's your age");

if(age > 13){
    console.log("dude your age is great but i take no responsibility!.");
}
else{
    console.log("please continue");
}

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 variable = userAnswer;
var userAnswer = prompt("Do you want to race Bieber on stage?");

if(userAnswer=="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("give your feed back from 1-10");
if (feedback=>8){
    console.log("Thank you! We should race at the next concert!");
}
else{
    console.log("I'll keep practicing coding and racing.");
}

Please use correct spacing and indentation, it makes things a lot easier. I have fixed your code. There where missing semi colons, if(userAnswer = "yes") should be if(userAnswer == "yes"), and if (feedback=" >8") should be if(feedback => 8) . Hope this helps :smile: .


#6

It returns following error in the end

Oops, try again. It looks like you didn't print the less than or equal to 8 message.

I am not able to finish this . Can someone help .

var userAnswer = prompt("Do you wnat to race Bieber on stage?");
//console.log("Suddenly, Bieber stops and says,'Who wants to race me?'");
if (userAnswer == "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 our game out of 10");

if (feedback >= 8)
{
console.log("Thank you! We should race at the next concert!");
}
else
{
console.log("Better luck next time");
}