0
0

More than 1 year has passed since last update.

shift(Ruby)は配列の最初の要素を取り除き、その値を返す

Last updated at Posted at 2022-01-30

Ruby 3.1 Arrayクラスshift

  • shiftは配列の最初の要素を取り除き、その値を返します
a = [0,1,2,3,4]
print a.shift
#=> 0
print a
#=> [1,2,3,4]
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0