title: Accumulator Loop in Javascript
body: <p>Create a function called <code>totalSales()</code>. The function will use a loop to ask the user to enter amounts until they enter the word "done". The body of the loop will add the input amount to a variable called totalSales. When the loop ends the function should display the value of totalSales in an alert. </p>
  
  <p>Here's what I have... </p>
  
  <pre><code>function totalSales()
  {
       var x = prompt("Enter numeric until done")
       var amount="";
       var totalSales=0;
  
       while(x!=="done") { 
           x = prompt("Enter numeric until done") 
  
           if(x==="done")
           {
               alert(totalSales += amount);       
           } 
       }  
   }
  </code></pre>
  
  <p>My onclick event handler works but I'm not sure how to add an unknown number to a variable. I cannot get it to add instead of concatenate. </p>