I have a class as shown below
class test{
constructor(x){
this.x = x;
}
}
And I have created an instance of this class and stored into a variable temp.
let temp = new test(10);
And I also have an object where I wish to put temp.
let obj = {};
obj[temp] = true;
But when I see obj, it does not contain what I expected, it contains
{[object Object]: true}
[object Object]: true
__proto__: Object
I am unable to figure out where am I going wrong, what does object Object stand for, any help would be highly appreciated.
UPDATE:
If I create another instance of the object let temp2 = new test(10); and check temp2 in obj it returns true and also temp in obj returns true.