How to check equality of two objects(only specific key values) which is one object type is number other one comes as a string type, but they are numbers. I want to check equality of x1, x2, x3 and x4 value of the two objects not all of the object values
var object1 = {
id: 1234
x1: "1.000000",
x2: undefined,
x3: "1.0",
x4: "1.0",
x5: somevale 1
};
var object2 = {
id: 3456
x1: 1,
x2: undefined,
x3: 1,
x4: 1,
x5: somevalue 2
};
I received the answer from How to check equality of two objects, one object's attribute's type is number other ones type is string but they are numbers This solution checks every attributes of the object which I get false for my two objects, because other attributes can not be same.