普通にやっても味気ないので、2パターン書いてみました
どっちでもあんまり変わらないけど...(;・∀・)
こんな感じ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1, 2, 3].select {|n| n == 2} # => [2] | |
[1, 2, 3].select &2.method(:==) # => [2] |
( ̄(エ) ̄)彡☆
0 件のコメント:
コメントを投稿