I'm having some troubles while checking if a map already has an object as key.
e.g.
const myMap: Map<MyObject1, MyObject2> = new Map<MyObject1, MyObject2>();
I also defined an equals function in MyObject1 class
equals(other: ThreatAgentMgm): boolean {
return other.id === this.id;
}
but myMap.has(myObject1)
is always false.
I read theat the has method is based on the === operator, should I define something else in MyObject1 class?