In Ruby, Array#size is an alias for Array#length. Beyond the name, they have no differences, and can be used interchangeably. They both return the number of elements in an array.
For example, you can get the length of an array with either one, like so:
puts [1, 2, 3].length #=> 3
puts [1, 2, 3].size #=> 3
For empty arrays, either method would return 0:
puts [].length #=> 0
puts [].size #=> 0