Last Updated: February 25, 2016
·
5.874K
· darkside73

Ruby each_slice with index

Ruby 1.8.7+

products.each_slice(3).with_index { |products_by_three, index| puts products_by_three, index }