Array indexing starts at 0, as in C or Java. ... To retrieve and at the same time remove the first item, use shift : arr.shift #=> 1 arr #=> [2, 3, 4, 5].
確定! 回上一頁