Array#values_at extracts several elements by index in one operation and returns those values as a new array. Pass one or more index arguments rather than a contiguous range. section 9.2.2
Select several words
Given `array = %w(the dog ate the cat)`, `array.values_at(0, 3)` retrieves the two articles and assigns them to `articles`; printing it produces the selected values as an array.
Place values_at among Ruby's related element-retrieval operations:
- Use `[index]` or `slice(index)` to retrieve one element. section 9.2.2
- Use `dig` when the requested positions lead through nested arrays rather than selecting several positions from one array. section 9.2.2
The same method name also appears on Hash. There, the arguments are keys instead of integer indexes: `state_hash.values_at("New Jersey", "Delaware")` returns `["NJ", "DE"]`. section 9.3.2
