Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- irb(main):001:0> class Array
- irb(main):002:1> def filter(&block)
- irb(main):003:2> self.select(&block)
- irb(main):004:2> end
- irb(main):005:1> end
- => :filter
- irb(main):006:0> [1, 2, 3].filter(&:even?)
- => [2]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement