You are viewing a single comment's thread. Return to all comments →
def func_any(hash) return hash.any? {|key, value| key.is_a? Integer} end def func_all(hash) return hash.all? {|key, value| value < 10} end def func_none(hash) return hash.none? {|key, value| value == nil} end def func_find(hash) return hash.find {|key, value| (key.is_a?(Integer) && value.is_a?(Integer) && value < 10) || (key.is_a?(String) && value.is_a?(String) && value.start_with?('a'))} end
Seems like cookies are disabled on this browser, please enable them to open this website
Ruby Enumerables: 'any', 'all', 'none', and 'find'
You are viewing a single comment's thread. Return to all comments →