Compare Array « Array « Ruby






1.Comparing Arrays
2.eql? returns true if the objects are the same or if their content is the same.
3.compare arrays is with <=> (spaceship operator).
4.Comparison: Returns an integer -1,0, or +1, if this array is less than, equal to, or greater than other_array.
5.Equality: equal if they contain the same number of elements and if each element is equal to the corresponding element in the other array.