6. Asking for feedback


#1

I don't understand whats wrong here help would be much appreciated
.
//Check if the user is ready to play!
confirm("i understand confirm");
var age = prompt("What's your age?");
if (age < 18)
{
console.log("You're allowed to play but we take no responsibility");
}
else
{
console.log("Play on");
}
console.log ("Snow White and Batman were hanging out at the bus stop, waiting to go to the shops. There was a sale on and both needed some new threads. You've never really liked Batman. You walk up to him.");
console.log ("Batman glares at you.");
var userAnswer = prompt("Are you feeling lucky punk?");
if (prompt = "Yes");
console.log("Batman hits you very hard. It's Batman and you're you! Of course Batman wins!");
//else
console.log("You did not say yes to feeling lucky. Good choice! You are a winner in the game of not getting beaten up by Batman.");
var feedback = prompt("Will you rate the game out of 10?");
if (feedback > 8)
{console.log("This is just the beginning of my game empire. Stay tuned for more!");}


#2

On this line you shouldn't be checking the prompt because prompt is a function. But by its variable name userAnswer.

And why is this else statement a comment??

If you also need it to run it should have brackets and so should your if statement that checks for userAnswer.


#3

thanks, but i got another error. this is what the error says.

//Check if the user is ready to play!
confirm("i understand confirm");
var age = prompt("What's your age?");
if (age < 18)
{
console.log("You're allowed to play but we take no responsibility");
}
else
{
console.log("Play on");
}
console.log ("Snow White and Batman were hanging out at the bus stop, waiting to go to the shops. There was a sale on and both needed some new threads. You've never really liked Batman. You walk up to him.");
console.log ("Batman glares at you.");
var userAnswer = prompt("Are you feeling lucky punk?");
if (userAnswer = "Yes");
console.log("Batman hits you very hard. It's Batman and you're you! Of course Batman wins!");
//else
console.log("You did not say yes to feeling lucky. Good choice! You are a winner in the game of not getting beaten up by Batman.");
var feedback = prompt("Will you rate the game out of 10?");
if (feedback > 8)
{
console.log("This is just the beginning of my game empire. Stay tuned for more!");}

Oops, try again. It looks like you didn't print the greater than 8 message.


#4

See here, there are a few mistakes


#5

if (condition) { statement; } else { statement;}