Last Updated: December 22, 2017
·
755
· krmbzds

Check If An Array Consists of Integers

[1, 2, 3, 4, 5].all? {|i| i.is_a?(Integer) }  #=> True
JSON.parse("[1,2,3,4]").all? {|i| i.is_a?(Integer) }  #=> True