Answer Posted / Ranjeet Kaur
In Ruby, a block is anonymous piece of code that can be passed around as an argument to methods. A Proc object (short for procedure) is a first-class function object that can be assigned to a variable, passed as an argument to other methods, and used to define default arguments. For example: `proc = Proc.new { puts 'Hello World' }; proc.call # outputs "Hello World"
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers