Ruby - Loops and Iteration
Which of the following is the correct syntax to use
each on an array numbers to print each number?each on an array numbers to print each number?eacheach followed by a block with { |variable| ... } or do |variable| ... end.numbers.each { |num| puts num } which is correct. Others have syntax errors or wrong order.each { |item| ... } or each do |item| ... end [OK]each numbers instead of numbers.each| | around block variable15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions