eql?(p1) public

Returns true if self and other are the same object, or are both arrays with the same content.

Show source
Register or log in to add new notes.
November 17, 2014
0 thanks

Elements need to be in same order

Note that even if the arrays have the same content, the elements need to be ordered:

Example:

x = [1, 2, 3]
y = [3, 2, 1]
z = [1, 2, 3]

x.eql?(y) #=> false
x.eql?(z) #=> true
x.eql?(y.sort) #=> true