Blocks, procs and lambdas Flashcards

1
Q

how to jump from a method to a block then back again to the method?

A

yeild

ps yeild can take parameters just like the method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is the different between a block and proc?

A

blocks are not objects and they cant be saved to variables, so we use procs to DRY our code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly