Vidyalelo
Ruby Programming · Q21

Blocks and Procs in Ruby

Programming · Ruby Programming · question 21

Q21

In Ruby, what is a closure?

A.
A function that accepts another function as an argument
B.
A function that returns another function
C.
A function that captures the state of its surrounding scope
Answer
D.
A function that is defined within another function

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board