Top "Equality" questions

Equality is a relationship between two or more items or variables or objects that exists if (1) the items are the same item, variable, or object or (2) the items are different items, variables or objects but they have the same value.

Why is [] !== [] in JavaScript?

Why is [] !== [] in JavaScript? I read through https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness but …

javascript equality equality-operator
Comparing boxed value types

Today I stumbled upon an interesting bug I wrote. I have a set of properties which can be set through …

c# equality boxing unboxing
Why == operator and equals() behave differently for values of AnyVal in Scala

In the scaladoc of scala.Any, the operator == (or, method ==) is explained: The expression x == that is equivalent to if (…

scala equals equality primitive
What problem does IStructuralEquatable and IStructuralComparable solve?

I've noticed these two interfaces, and several associated classes, have been added in .NET 4. They seem a bit superfluous to …

.net equality icomparable iequalitycomparer
isEqual doesn't always work for NSIndexPath? What can I use in its place?

I've got some code that relies on comparing two NSIndexPaths and executing different code based on their equality or lack …

objective-c equality iphone-sdk-3.2 nsindexpath
Set "in" operator: uses equality or identity?

class A(object): def __cmp__(self): print '__cmp__' return object.__cmp__(self) def __eq__(self, rhs): print '__…

python set identity operator-keyword equality
How do I check the equality of three values elegantly?

Say I have values a, b and c. I want to find out if they are equal. If I do …

go syntax equality readability convention
Will the var members in case class affect case class's equality?

I have made heavy use of case classes in my code, replying on the underlying equality definitions of case class …

scala equality case-class algebraic-data-types
Can I overload an == operator on an Interface?

I have an interface like this: public interface IFoo { int A {get;} int B {get;} } and I have multiple classes …

c# .net interface equality iequatable
What sort of equality does the Apache Commons ObjectUtils equals method test for?

I have always understood there to be two types of equality in Java, value equality : uses the .equals() method to …

java equals apache-commons equality apache-commons-lang