RubyFlow The Ruby and Rails community linklog

Array#sample - the simplest way to get a random element(s) from array

Here’s a quick tip on how to get a random element from array using Array#sample - http://blog.ugisozols.com/2012/08/28/array-sample.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in