Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby assign rest of array

a = [1, 2, 3]
b, *rest = *a

b    # => 1
rest # => [2, 3]
a    # => [1, 2, 3]
 
PREVIOUS NEXT
Tagged: #ruby #assign #rest #array
ADD COMMENT
Topic
Name
2+3 =