0
What is the difference between .eql? and == in Ruby ?
2 Answers
0
== operator is used to compare the values of the operands but the .eql? is used to compare the data types.
0
== is used to compare the values of the operands but the .eql? is used to compare the data types. For example,
5==5.0
but
5.eql?5.0
is not true