kernel/common/array.rb
# Returns number of non-nil elements in self, may be zero
Returns number of non-nil elements in self, may be zero
Returns number of non - nil elements in self may be zero
def nitems
    sum = 0
    each { |elem| sum += 1 unless elem.nil? }
    sum
  end
def nitems sum = 0 each { | elem | sum += 1 unless elem . nil? } sum end
Returns number of non-nil elements in self, may be zero
Returns number of non - nil elements in self may be zero