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.
イン・アーブ
[[]] | [3]
生産する
[[], 3]
私はそれを理解するのに少し苦労しています。OR 演算子はここでどのように機能していますか?
ドキュメントによると 、
Set Union — ary を other_ary と結合し、重複を除外して元の配列の順序を維持することにより、新しい配列を返します。
[1,2,3] | [4,5,6] # => [1, 2, 3, 4, 5, 6] [1,2,3] | [4,1,2] # => [1, 2, 3, 4]