Introduction
Blocks let you group code to run later or multiple times. They make your code cleaner and easier to reuse.
When you want to repeat actions for each item in a list.
When you want to run some code only inside a method call.
When you want to pass a small piece of code to another method.
When you want to organize your code clearly without making a new method.