Javascript: select random element from array that is not equal to 'undefined'
<p>I have an array that has only had specific keys set. The array will look something like</p>

<pre><code>arr[0] = 'undefined';
arr[1] = '16';
arr[2] = 'undefined';
arr[3] = '13';
arr[4] = 'undefined';
arr[5] = 'undefined';
arr[6] = '24';
arr[7] = 'undefined';
</code></pre>

<p>From that particular array I would want to randomly select either 16, 13, or 24.</p>

<p>Is there a good way to do this?</p>

<p>Thanks,<br>
Sam</p>
