title: Javascript order execution of prompt and document.writeln statements
body: <p>I am trying to write a program that iteratively solves a problem with user input. It is something like trying to guess a user's number between 0 and 100 using binary search. </p>
  
  <p>So the program spits something out (in the form of 
  document.writeln statements); then asks the user for a new input (using prompt()); does some more crunching and spitting out until eventually it terminates. Here is my problem:</p>
  
  <p>The program does not execute the document.writeln statements until it has executed all of the
  prompt statements. The rest of the statements execute in proper order. </p>
  
  <p>I'd really appreciate some help on understanding why this this happening. I know that Javascript has a peculiar notion of execution order and perhaps it is doing this because it likes to do the prompt()'s first because they are alerts, but I still don't get it.</p>
  
  <p>thanks</p>