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?

```
And as usual, remember that `.any?` will not give you a hit if you array is filled with `false` or `nil`.

```
[[false], [nil], [true], []].count &:any? #=> 1 only one non-empty (true)

```

Perhaps it is better to do:

```
[[false], [nil], [true], []].reject(&:empty?).count #=> 3 non-empty (true, nil, false)

```