Tell me what are blocks and procs?
Answer / 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 |
Can you please explain what is the difference between string and symbol?
what is the role of sub-directory app/controllers and app/helpers?
What is the difference between throw/catch and raise/rescue?
Explain Ruby module?
Explain me what is the difference between symbol and string?
Explain about variables?
Tell me how symbol is different from variables?
Why Ruby is known as a language of flexibility?
What is ruby methods?
Overview of ruby programming language?
How would you implement hash in ruby internally?
What is concatenating string in Ruby?