title: How to split numbers into individual
body: <p>I have this whole number <strong>75892</strong>. i want to split it in individual and then add below is my code. it works fine but <strong>is there any other solution to minimize my code?</strong> thanks</p>
  
  <pre><code>var x=75892;
  var d,ans=0;
  while(x!=0){
      d=x%10;
      ans=ans+d;
      x=parseInt(x/10);
  }
  document.write("SUM:"+ans);
  </code></pre>