mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-26 20:34:32 +03:00
commit
d1a822f96c
@ -168,6 +168,10 @@ array[-1] #=> 5
|
||||
# With a start index and length
|
||||
array[2, 3] #=> [3, 4, 5]
|
||||
|
||||
# Reverse an Array
|
||||
a=[1,2,3]
|
||||
a.reverse! #=> [3,2,1]
|
||||
|
||||
# Or with a range
|
||||
array[1..3] #=> [2, 3, 4]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user