Accessing array by slicing

Question?

array = [A,B,C,D]

array[1] => B
array[3] => D

array[1,2] => [B,C]
array[0,3] => [A,B,C]

Why does array[4,0] return [], yet array[5,0] returns nil?

Both should be out of bounds.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs