LoginSignup
0
0

More than 3 years have passed since last update.

配列から複数の要素を取り出す方法

Posted at

paizaのスキルチェックに使った内容を投稿しました。

array.each_cons(引数) {|arr| block }

引数で指定した数の要素を繰り返し取り出して、ブロックを実行

ブロック引数には取り出した要素が配列で入る

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