This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Mina Fadaie
over 9 years

Why do all the questions get asked before you can read any information?

I completed this with no issues or errors, but when I run the code it asks all the questions at once before logging anything into the console, so you have to answer before you can even read what is happening in the game. Is it supposed to run like this or did I miss something along the way? Or is having it go in order something that is too advanced for this stage?

Answer 544929db282ae34081002df7

0 votes

Permalink

@Mina Fadaie, As i have no code of yours to work with…i am not able to point out anything… Regards,Leon

points
Submitted by Leon
over 9 years

Answer 5473c65f8c1ccc5db6000034

0 votes

Permalink

also a thing for me. I know that it’s because the code wasn’t told to wait for a little while so we could read the text. What I’m confused about is why learning how to tell the code to wait wasn’t part of the lesson … i think making the no answer to Do you want to race? actually do something was also left out, this leaves the end result less of a game and more of a … follow the leader type thing ( _ ) my code // Check if the user is ready to play! confirm(“Are you ready to play?”) var age = prompt(“What’s your age”); if(age < 13) { console.log(“Ask a parent first!”) } else // “otherwise” { console.log(“Go right in!”) } 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(userAnswer = “yes”) { console.log( “You and Bieber start racing. It’s neck and neck! You win by a shoelace!” ) } else // “otherwise” { console.log( “Oh no! Bieber shakes his head and sings ‘I set a pace, so I can race without pacing.’” ) } var feedback = prompt(“Please score the game out of 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.”) }

points
Submitted by Alexis West
over 9 years

Answer 5473db728c1ccc708c000457

0 votes

Permalink

I’m not sure if it will pass validation because they want you to use console.log()

However, on the very last exercise 7/7 you can substitute all the console.log() by either confirm() or alert().

In this way you will get all the responses on the browser.

The reason why you don’t see the responses is because they are all happening on the CONSOLE while the questions are happening on the main browser.

By changing all console.logs to alert() or confirm() you will have to tell JavaScript to do the next step and that gives you a feeling that you are participating in the game.

Hope it helps.

points
Submitted by tony de araujo
over 9 years