title: jquery. Is it acceptable var = var+1?
body: <p>For example input field</p>
  
  <pre><code>&lt;input type="text" name="input[]" id="input0" class="input"  value='3' &gt;
  </code></pre>
  
  <p>I do calculations and result for <code>id="input0"</code> is based on (previous) value of <code>id="input0"</code></p>
  
  <p>like this (like php)</p>
  
  <pre><code>$('#input0').val( parseInt($('#input0').val(),10) + somevar ).change();
  </code></pre>
  
  <p>When tried seems all works. But is coding is good coding? No problems because of such coding?</p>
  
  <p>Edit</p>
  
  <p>I mean because of such coding is result always what I expect.</p>
  
  <p>initial value of <code>input0</code> is <code>3</code></p>
  
  <p><code>somevar = 4</code> (for example)</p>
  
  <p>So new value of <code>input0</code> I expect 7 (3+4). So <code>input0 = input0 + somevar</code></p>
  
  <p>As far as i tested result is as expected. But is such coding a good practice?</p>