Back to Developer Roadmap

Closures

src/data/roadmaps/ruby/content/[email protected]

4.0871 B
Original Source

Closures

A closure is a block of code that can be passed around and executed later, even after the scope in which it was originally defined has ended. It "closes over" its surrounding environment, capturing the values of variables that were in scope when the closure was created. This allows the closure to access and use those variables even when it's executed in a different context.

Visit the following resources to learn more: