2019-09-26から1日間の記事一覧
概要 eachとmapの使い分けがようやく実感として掴めた気がした。 返り値が違う。 eachの返り値 eachは繰り返し処理を実行したオブジェクトを返す。 ary = ["./hello/11", "./hello/22", "./hello/33"] test = [] ary.each { |a| test << a.delete_prefix("./…
概要 eachとmapの使い分けがようやく実感として掴めた気がした。 返り値が違う。 eachの返り値 eachは繰り返し処理を実行したオブジェクトを返す。 ary = ["./hello/11", "./hello/22", "./hello/33"] test = [] ary.each { |a| test << a.delete_prefix("./…