check if element is array ruby code example
Example 1: ruby array has element
>> ['Cat', 'Dog', 'Bird'].include? 'Dog'
=> true
Example 2: how to check if data is an array or not ruby
.kind_of?(Array)
>> ['Cat', 'Dog', 'Bird'].include? 'Dog'
=> true
.kind_of?(Array)