Check out example codes for "test if array empty ruby". It will help you in understanding the concepts better.

Code Example 1

irb(main):001:0> [].length
=> 0
irb(main):002:0> [1].length
=> 1
irb(main):003:0> [1, 'foo'].length
=> 2

Learn ReactJs, React Native from akashmittal.com