Ruby Array - Selection

  • + 0 comments
    • arr.select{|a| a.odd?}
    • arr.reject {|a| a % 3 == 0}
    • arr.delete_if {|a| a.negative?}
    • arr.keep_if {|a| a >= 0}