ruby shorthand for looping in arrays code example Example: ruby how to loop through an array array = [1, 2, 3, 4, 5, 6] array.each { |x| puts x }