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
- Ruby | pop() function
- Ruby | Set add? function
- Ruby | StringScanner eos? function
- Ruby | Matrix row() function
- Ruby Integer even? function with example
- Ruby | Numeric dup() function
- Ruby | Complex -@ function
- Ruby | Numeric abs() function
- Ruby | Set superset? function
- Ruby | Numeric div() function
- Ruby | Symbol next function
- Ruby Integer lcm() function with example
- Ruby Integer gcd() function with example
- Ruby | Set subset? function
- Ruby | Numeric arg() function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.