Last Updated: February 25, 2016
·
6.28K
· 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 }