#配列の中に値を追加。
a = [1, 2, 3]
a.insert(2, "a") => [1, 2, "a", 3]
(2, "a")の第一引数(2)が何番目に追加するか、第二引数が何を入れるかとなる。
Go to list of users who liked
More than 5 years have passed since last update.
#配列の中に値を追加。
a = [1, 2, 3]
a.insert(2, "a") => [1, 2, "a", 3]
(2, "a")の第一引数(2)が何番目に追加するか、第二引数が何を入れるかとなる。
Register as a new user and use Qiita more conveniently
Go to list of users who liked