Question: I have an array of arrays like this:

```
[row1, row2, row3]

```

I need to find how many of those rows are not empty (have some object inside). I know I can do row1.any?, but how would I find how many of those are in the array?

Answer: 
Use the block form of [`Array#count`](http://www.ruby-doc.org/core-2.1.0/Array.html#method-i-count):

```
[row1, row2, row3].count &:any?

```
What about this?

```
[row1,row2,row3].select { |arr| arr.any? }.size

```

You [select](http://ruby-doc.org/core-2.1.0/Enumerable.html#method-i-select) just the objects (arrays) which have any elements, and then calculate the size of that resulting Array.