Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Array#empty?
() -> bool
empty? → true or false
array.c
View on GitHub ↗
static VALUE
rb_ary_empty_p(VALUE ary)
{
return RBOOL(RARRAY_LEN(ary) == 0);
}
Returns true if the count of elements in self is zero, false otherwise.
Related: see Methods for Querying.