title: can you use do-while instead of while(true) in this textbook exercise?
body: <p><strong>Textbook exercise:</strong></p>
  
  <p>Write the function sumInput() that:</p>
  
  <ol>
  <li>Asks the user for values using prompt and stores the values in the array.</li>
  <li>Finishes asking when the user enters a non-numeric value, an empty string, or presses “Cancel”.</li>
  <li>Calculates and returns the sum of array items.</li>
  </ol>
  
  <p>P.S. A zero 0 is a valid number, please don’t stop the input on zero.</p>
  
  <p><strong>Textbook solution:</strong></p>
  
  <pre><code>function sumInput() {
  
    let numbers = [];
  
    while (true) {
  
      let value = prompt("A number please?", 0);
  
      // should we cancel?
      if (value === "" || value === null || !isFinite(value)) break;
  
      numbers.push(+value);
    }
  
    let sum = 0;
    for (let number of numbers) {
      sum += number;
    }
    return sum;
  }
  </code></pre>
  
  <p>Personally I dislike <code>while (true)</code> because it doesn't seem as intuitive. Would it be wrong to try to rewrite as a <code>do--while</code>? (Even if there's a special gotcha that makes <code>do--while</code> NOT work in this case, I'd STILL like to know if <code>while (true)</code> is just some... very accepted universal usage or not)</p>
  
  <p>Something like:</p>
  
  <pre><code>function sumInput() {
  
    let numbers = [];
  
    do {
      let value = prompt("A number please?", 0);
      numbers.push(+value);
    }
    while ( (value !== "" || value !== null) &amp;&amp; isFinite(value) );
  
    let sum = 0;
    for (let number of numbers) {
      sum += number;
    }
    return sum;
  }
  </code></pre>