Given an array like this:
a = [1,2,3]
When I do a[3]
it returns nil
. And that makes sense because there is no more than 3 elements. However, when I do a slicing with a[3,0]
or a[3,1]
, I get []
Why is that?
Given an array like this:
a = [1,2,3]
When I do a[3]
it returns nil
. And that makes sense because there is no more than 3 elements. However, when I do a slicing with a[3,0]
or a[3,1]
, I get []
Why is that?