Using things like each_index.select is shorter, more clear, and faster than using explicit iteration and growing the array one by one.