Ruby - Blocks, Procs, and Lambdas
How can you create a Proc that accepts any number of arguments and returns their sum?
|*args| allows the Proc to accept any number of arguments as an array.args.sum returns the sum of all arguments.|*args| to accept multiple arguments and sums them.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions