Question: What is the difference between a block and a lambda in Ruby?Incorrect answer:A block is used for data structures, and a lambda is not.Correct Answer:A
What is the difference between a block and a lambda in Ruby?Incorrect answer:A block is used for data structures, and a lambda is not.Correct Answer:A block is just an unnamed piece of code, whereas a lambda is a function object.They are the same thing with different syntax., Not SelectedA block is just an unnamed piece of code, whereas a lambda is a function object., Not SelectedA lambda is used for multithreading, and a block is not.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
