Over a million developers have joined DZone.

Use Array#all? To Identify An Array Containing Nil

·
Determine if all items in an array are workable object using Array#all? e.g.

['cat', nil, 'bat', 'mat'].all?    #=> false
['cat', 'hat', 'bat', 'mat'].all?  #=> true


Resources:
 - Module: Enumerable [ruby-doc.org]
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}