Ruby - Loops and Iteration
What is the issue with this Ruby code snippet?
arr = [1, 2, 3] arr.each do n puts n end
arr = [1, 2, 3] arr.each do n puts n end
do...end blocks with iterators, block parameters must be enclosed in pipes.do n instead of do |n|, which is a syntax error.do |n| -> Option Ado without block parameterseach can't use do...end15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions