title: Determine an Odd/even Number, And Use While Loop To Add From Counter in Javascript
body: <p>I do not know why it stops looping after satisfying the condition sometime(eg.getting the sum of number from where it precedes). I believe that there's something wrong with the code. Where is it?</p>
  
  <pre><code>var init = parseInt(prompt('enter an odd or even no.'));
  var sec = init%2;
  
  if (sec != 0) {
      var loop = 5;   
      while (loop &lt; 10) {
          var num = 1;
          loop += loop; 
          num += 2
      }
      document.write(num);
  } else {
      document.write('None');
  }   
  </code></pre>