[Solved] Accessing ruby elements

[ad_1]

arr[-1] gives you the last element of arr, arr[-2] the second-to-last element and so on.

arr[2, 3] gives you from the element at index 2, three elements of arr

arr[2..3] gives you from the element at index 2 to the element at index 3

2

[ad_2]

solved Accessing ruby elements