Home
Ruby
ActiveRecord
Array
CGI
Class
Collections
Database
Date
Design Patterns
Development
File Directory
GUI
Hash
Language Basics
Method
Network
Number
Rails
Range
Reflection
Statement
String
Threads
Time
Tk
Unit Test
Windows Platform
XML
Menu
Compare Array « Array « Ruby
Ruby
Array
Compare Array
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.