Ruby Developer Question:
What is the difference between Procs and Blocks?
Answer:
The difference between Procs and Blocks,
☛ Block is just the part of the syntax of a method while proc has the characteristics of a block
☛ Procs are objects, blocks are not
☛ At most one block can appear in an argument list
☛ Only block is not able to be stored into a variable while Proc can
☛ Block is just the part of the syntax of a method while proc has the characteristics of a block
☛ Procs are objects, blocks are not
☛ At most one block can appear in an argument list
☛ Only block is not able to be stored into a variable while Proc can
Previous Question | Next Question |
Tell us how would you implement hash in Ruby internally? | Tell me what is ORM (Object-Relationship-Model) in Rails? |