Am stuck at "First Move"


#1

Am getting this

Oops, try again.
Did you remember to console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'"); ?

This is the code blow:

` // Check if the user is ready to play!

confirm ("You should get ready to play");

var age = prompt("what's your age");
if (age < 13)
{
console.log("You can choose to continue at your own risk");
}
else
{
console.log("Wow! you're welcome to the game.");
}
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?");

`


#2

You have one console.log() too many. It should have been like this, you've put it on the wrong place.

// Check if the user is ready to play!
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");
var age = prompt("What's your age?");
if (age < 13 ){
    console.log("You are not old enough for this shit.");
}else{
    confirm("Ready?");
}

console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'");
var userAnswer;
userAnswer = prompt("Do you want to race Bieber on stage?");

#3

w in who should be uppercased.


#4

That's not the problem.

In fact - order of console.log statements in his code complies with the flow of the exercises. Moreover, there is no need to post the whole code that is completely different from the code of the user (messages, separated definition, and assignation). And just try to keep good level of culture, even in posted code :slight_smile:

Try to help the user by proposing minimal changes to make his code correct.


#5

I had problems with some exercises when printed strings were in wrong order, but you're right for this one, I guess it was only the lowercase "w" here. Gotta admit I didn't notice the lowercase letter at first, so my guess was wrong console.log() order. And since I had "You are at a Justin Bieber concert..." in first line, and it worked for me, I thought it should have been in the first line. My mistake. :slight_smile:


#6

I completely understand :slight_smile:

I just don't like posting alternative solutions without explaining what is wrong with the first one. Kudos to you for helping others!


#7

Same to you good sir. :slight_smile:
I also usually try to see the posted code and have them fix it or try to fix it for them, before providing the working code. That probably helps the most because most people here have little knowledge but want to learn more, and best way to learn is from good advices that help you fix mistakes.