LoginSignup
11
9

More than 5 years have passed since last update.

【Ruby】数列(配列)を簡単につくる

Posted at

0~13など、数列がほしいときに
いちいち書くのは面倒くさい。
ループにするのも、大げさな。

Rangeを配列に変換する って手があった。

 [*0..13] # => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
11
9
2

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
11
9