<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>round-rand</author_name>
  <author_url>https://blog.hatena.ne.jp/round-rand/</author_url>
  <blog_title>ランドML</blog_title>
  <blog_url>https://ml-rand-note.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>insert：任意の位置への挿入 unshift(prepend)：先頭に追加 push(append)：末尾に1つ以上の要素を追加 &lt;&lt;：末尾に要素を1つ追加 concat：配列の結合 参考 insert：任意の位置への挿入 insert(n, x) でn番目にxを挿入します。 arr = [1, 2] # 1番目に0を追加 arr.insert(1, 0) p arr # =&gt; [1, 0, 2] # 2番目に4, 5を追加 arr.insert(2, 4, 5) p arr # =&gt; [1, 0, 4, 5, 2] unshift(prepend)：先頭に追加 unshift(prepe…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fml-rand-note.hatenablog.com%2Fentry%2Fruby%2Farray-add-elements&quot; title=&quot;【Ruby】配列への要素の追加方法まとめ - ランドML&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-06-04 00:00:00</published>
  <title>【Ruby】配列への要素の追加方法まとめ</title>
  <type>rich</type>
  <url>https://ml-rand-note.hatenablog.com/entry/ruby/array-add-elements</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
