Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
このような
oldArray = [[a, b, c, d],[e, f, g, h]]
oldArray の各要素に、たとえば要素 2 の新しい配列を返す 1 行のコードが必要です。
newArray = coolLine(oldArray, 2) newArray -> [c, g]
これは要素番号 2 を行います。
oldArray.map { |a| a[2] }