I'm new to javascript, thus the question. I've the following object,
class Node{
constructor(data){
this.data = data;
this.adjacencySet = new Set();
}
addEdge(node){
this.adjacencySet.add(node)
}
getAdjacentVertices(){
return this.adjacencySet;
}
}
How do I check the presence of this object in a hash map. An analogy would be in Python I'd add the following method in the class,
def __eq__(self, other):
return this.data == other.data
How can do a similar object comparison in javascript?