Robust String Split
<p>I have a JavaScript function:</p>

<pre><code>function doSomething(arg) {
    var array = arg.split(',');
    // etc...
}
</code></pre>

<p><code>arg</code> is populated using jQuery's <code>.data('myId')</code> function.</p>

<p>Often, <code>myId</code> contains a comma separated list of integers and the code works great.  However, if <code>myId</code> only contains a single integer, the code fails with the error</p>

<blockquote>
  <p>Object doesn't support property or method 'split'</p>
</blockquote>

<p>Is there a compact, robust method to create the array without including <code>if</code> statements to handle the boundary conditions of one integer or an empty string?</p>
