Ruby - Blocks, Procs, and Lambdas
Which of the following is the correct syntax to create a lambda in Ruby?
->(args) { block } or lambda { block }. The arrow syntax is common and concise.proc. lambda = lambda.new { |x| x * 2 } is invalid syntax.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions