When destructuring an array, you can unpack and assign the remaining part of it to a variable using the rest pattern
a = [1, 2, 3]
b, *rest = *a
b # => 1
rest # => [2, 3]
a # => [1, 2, 3]
When destructuring an array, you can unpack and assign the remaining part of it to a variable using the rest pattern
a = [1, 2, 3]
b, *rest = *a
b # => 1
rest # => [2, 3]
a # => [1, 2, 3]