Ruby - Blocks, Procs, and Lambdas
Which of the following is the correct syntax to yield to a block only if it was given?
yield only if a block is given, checked by block_given?.yield if block_given? correctly calls the block only when present.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions