Console doesn't print out messages until after all the prompts are done


No error messages or anything, but all the alerts come up before the messages are printed in the console. For example, I get asked if I want to race Bieber before it talks about Bieber asking who wants to race.

I suppose I could use alerts instead of simply logging the messages in the console, but that doesn't seem to be what we're supposed to do.

// Check if the user is ready to play!
confirm("Ready to play?");
var age = prompt("What's your age");
if (age < 13) {
    console.log("You can play, but I take no responsibility");
} else {
    console.log("Cool, play on!");

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 = confirm("Do you want to race Bieber on stage?");
if ("userAnswer" === true) {
    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.'");


Also asked here, but no resolution.


i answered it here:

The console does display while prompting?


Maybe it's a browser or OS thing. I just tried it on macOS, with both Safari and Chrome, and in both cases, the messages didn't display until after the prompts.


that is weird, what if you run on jsbin? select javascript and console tab, and press run js in the top right to run the code


Same deal.

I tried just saving the code in a .html file and wrapping it in tags, and it actually worked as expected.


you can search (using google) to see if you can find the issue

personally, i would ignore it and move on. The console is generally used for debugging, so the order of prompts and console.log is not that important


Yeah, I'm just gonna take it as some funkiness of the in-site console.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.