Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby array infinity

("a".."z").take(5) # ["a", "b", "c", "d", "e"]
(1..Float::INFINITY).take(5) # [1, 2, 3, 4, 5]
[1, 2, 3].cycle.take(5) # [1, 2, 3, 1, 2]
Array.new(5) { rand(1...9) } # [2, 4, 8, 6, 7]
 
PREVIOUS NEXT
Tagged: #ruby #array #infinity
ADD COMMENT
Topic
Name
3+7 =