Ruby - Loops and Iteration
Which of the following is the correct syntax to use the
times method with a block variable?times method with a block variable?do |var| ... end or { |var| ... } for blocks.do |i| ... end correctly. 5.times { |i puts i } misses the closing pipe around the block variable. Options A, B, and D have syntax errors.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions