title: How to convert an integer into an array of digits
body: <p>I want to convert an integer, say <code>12345</code>, to an array like <code>[1,2,3,4,5]</code>.</p>
  <p>I have tried the below code, but is there a better way to do this?</p>
  <pre><code>var n = 12345;
  var arr = n.toString().split('');
  for (i = 0; i &lt; arr.length; i++) arr[i] = +arr[i] | 0;
  </code></pre>