Block Return Values

Remember when we learned that a block returns a value just like methods do? So far, in our two previous examples, we didn’t do anything with the block’s return values.

An example using collect

Here’s an example that does that:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy