The at() function in Ruby is used to return the element of the specified index. Index 0 is for the first element of the array, 1 for the second element of the array and so on. The negative index counts from the end of the input array.
Here Array is the input array of elements at which at() function is called.
Index : Its corresponding elements are to be returned and this index may be negative, positive or zero.
Returns: the corresponding elements whose index is taken as the parameter.
a b d gfg GeeksforGeeks Geeks
0 1 3 10 40 20