2018年7月25日
摘要: a = %w(a b cD)map: 针对每个element进行变换并返回整个修改后的map a.map do |item| a.upcase end a.map(&:upcase) 一样的效果, &:代表了item, 太简洁了,但格式难记。reduce: 把array变换为一个值后返回。 a.re 阅读全文
posted @ 2018-07-25 11:12 qinyan20 阅读(1188) 评论(0) 推荐(0) 编辑