Ruby - Blocks, Procs, and Lambdas
Which of the following is the correct syntax for a Ruby block using curly braces?
{} with the block parameter between pipes and the block code inside.{ |item| puts item }. array.each do |item| puts item end uses do..end, not curly braces. array.each (|item| { puts item }) has wrong parentheses and braces. array.each { |item| puts item end } mixes braces with do..end incorrectly.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions