all?
if code block to each element of array or hash is true, then return true
ex:
rabbits.all?( &: valid? )
any?
accept block, if code block to any element of array or hash is true, then return true
[1,2, 3].any? { |i| i>2 }
--> ture
張貼留言
沒有留言:
張貼留言