Ruby

最近の Ruby の発見 221028

ネスト構造の配列に複数の配列を追加 以下のように書くのは冗長 parent = [] child_1 = [1, 2, 3] child_2 = [4, 5, 6] child_3 = [7, 8, 9] parent << child_1 parent << child_2 parent << child_3 p parent # [[1, 2, 3], [4, 5, 6], [7, 8, 9]] 以下のよ…