DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR RUBY
rails select arbitrary n element from array
array = [1, 2, 3, 4, 5, 6] array.shuffle.first(3) # => [5, 2, 4]
PREVIOUS
NEXT
Tagged:
#rails
#select
#arbitrary
#element
#array
ADD COMMENT
Topic
COMMENT
Name
8+2 =
Submit