diff options
author | Zachary Ferguson <zfergus2@users.noreply.github.com> | 2015-10-06 18:19:20 -0400 |
---|---|---|
committer | Zachary Ferguson <zfergus2@users.noreply.github.com> | 2015-10-06 18:19:20 -0400 |
commit | c4f93c0b0ec1fcea11e336b67929b9d6f426765c (patch) | |
tree | a97e9f7a56330e45122bb81bb5194f2aefe03fdb /ruby.html.markdown | |
parent | 29cbff176857653422555650c983afef4a28ae1f (diff) | |
parent | 55c80f255202b03c4c3a66ac1d37f880a3782b68 (diff) |
Merge remote-tracking branch 'adambard/master'
Conflicts:
java.html.markdown
Diffstat (limited to 'ruby.html.markdown')
-rw-r--r-- | ruby.html.markdown | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ruby.html.markdown b/ruby.html.markdown index 7bd28d86..8f23b2e6 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -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] |