each, map, and select (Ruby)

each iterates a collection running a block per element (returning the original); map transforms each element into a new array; select filters, keeping…