Destructuring Block Arguments

suggest change
triples = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]

triples.each { |(first, second, third)| puts second }
# 2
# 5
# 8

triples.map { |(first, *rest)| rest.join(' ') } # => ["2 3", "5 6", "8 9"]

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Destructuring:
*Destructuring Block Arguments

Table Of Contents