What is wrong i did everything what it says!(5 and 6)


#1

// Check if the user is ready to play!
confirm ("I am ready to play")
var age = prompt("Whats your age")
if (age <=13)
{
console.log("You can play but i dont take responsibility")
}
else (age>13)
{
console.log("You can play now");
}
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 userAnswer = prompt("Do you want to race Bieber on stage?")
if (userAnawer === "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("Rate my story");
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

It acctualy works but some part (in The story heats up) isnt right, help!


#3

Ok as a first the line which checks
else (age>13)
should be >=
and the same with
if (feedback=8)

Also don't forget your semi-colons.

I am also seeing a lot of indentation errors.

If you want i could post my own code to show you.
Hope this helped :wink:


#4

LOL u know whats the problem? I didnt even noticed that i wrote userAnawer except userAnswer hahaha:


#5

I have a problem at D.R.Y principle now .


#6

I am just trying to help, coding in actual programs are harder and they don't give you specific instructions!

Believe me I had a ton of errors when I tried myself, mainly of which were Syntax Errors.


#7

Don't Repeat Yourself, what there?