I’m going through [URL=”http://rubykoans.com/”]Ruby Koans
[code]
def test_slicing_arrays
array = [:peanut, :butter, :and, :jelly]
assert_equal [:peanut], array[0,1]
assert_equal [:peanut, :butter], array[0,2]
assert_equal [:and, :jelly], array[2,2]
assert_equal [:and, :jelly], array[2,20]
[COLOR=”#FF0000″]assert_equal [], array[4,0][/COLOR]
assert_equal [], array[4,100]
[COLOR=”#FF0000″]assert_equal nil, array[5,0][/COLOR]
end
Thanks.