Cleaner code using map in stead of each

Why write so many lines of code if you can do the same with just one