StackOverflow 文件 Ruby Language 教程 多維陣列 初始化 3D 陣列 初始化 3D 陣列 Created: November-22, 2018 你可以進一步向下並新增第三層陣列。規則不會改變: my_array = [ [ [1, 1, 2, 3, 5, 8, 13], [1, 4, 9, 16, 25, 36, 49, 64, 81], [2, 3, 5, 7, 11, 13, 17] ], [ ['a', 'b', 'c', 'd', 'e'], ['z', 'y', 'x', 'w', 'v'] ], [ [] ] ] 訪問巢狀陣列初始化 2D 陣列