1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-17 20:11:57 +02:00

Merge pull request #416 from jmromer/ruby-array

Corrects Array#[,] entry
This commit is contained in:
Nami-Doc
2013-11-20 04:08:17 -08:00

View File

@@ -139,8 +139,8 @@ array.[] 12 #=> nil
# From the end
array[-1] #=> 5
# With a start and end index
array[2, 4] #=> [3, 4, 5]
# With a start index and length
array[2, 3] #=> [3, 4, 5]
# Or with a range
array[1..3] #=> [2, 3, 4]