title: How do I pick randomly from an array?
body: <p>I want to know if there is a much cleaner way of doing this. Basically, I want to pick a random element from an array of variable length.  Normally, I would do it like this:</p>
  
  <pre><code>myArray = ["stuff", "widget", "ruby", "goodies", "java", "emerald", "etc" ]
  item = myArray[rand(myarray.length)]
  </code></pre>
  
  <p>Is there something that is more readable / simpler to replace the second line? Or is that the best way to do it. I suppose you could do <code>myArray.shuffle.first</code>, but I only saw <code>#shuffle</code> a few minutes ago on SO, I haven't actually used it yet.</p>