method
empty?
![Some documentation Importance_1](https://d2vfyqvduarcvs.cloudfront.net/images/importance_1.png?1349367920)
Register or
log in
to add new notes.
szeryf -
June 25, 2009
![Default_avatar_30](https://www.gravatar.com/avatar/024f6d59fd34ceca04f3fc18a87bdb98?size=30&default=http://apidock.com/images/default_avatar_30.png)
2 thanks
Antonym of empty?
The antonym of empty? is Enumerable#any? method:
[].empty? #=> true [].any? #=> false [1].empty? #=> false [1].any? #=> true
Be cautious however, if your array might contain nil’s or false’s:
[false, nil].any? #=> false