4 What am i doing wrong


#1



Replace this line with your code.


#2

confirm ("i understand confirm!");

var age = prompt("what's your age?");

if(age < 13)

{
console.log("your allowed to play but i take no resposibility.");
}
else
{
console.log("have fun playing!");
}
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 userAwswer;
var userAnswer = prompt("Do you want to race Bieber on Stage?");

#3

do not use:

just do: console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'")

userAnswer = prompt("Do you want to race Bieber on stage?")


#4

here use this:
confirm("I understand confirm!");
var age = prompt("what's your age");
if(age -= 13)
{
console.log("you shouldn't give out your personal information online");
}
else
{
console.log("Yay!");
}

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?'")

userAnswer = prompt("Do you want to race Bieber on stage?")


#6

Thats not right should be a <

userAnswer is undefined here so it needs to be

var userAnswer=prompt("Do you want to race Bieber on stage?")


#7

The code worked for me. Maybe a bug?


#8

@cindercoder

probably is a bug.


#9

I have done this, and it still does not work for me, any way I can skip on to the next exercise? Thanks,

Maria


#10

did you try using if(age<13)
instead of if(age-=13)?


#11

This is the original code i inputted, although i'm having problems just replying, it keeps displaying '502 Bad Gateway' when ive clicked on Q&A Forums and 'Reply', worked on last try..

confirm("I am ready to play");
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 for it");
}
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?");