I would like to compare two objects: I try to use this function:
export const isArrayEqual = (x, y) => {
console.log('x',x);
return _(x).xorWith(y, _.isEqual).isEmpty();
};
But i think that is not enought deep to check all the properties of the object. How can i do it, deepless and check all the properties with the same function?
obj1:
{
"list": {
"text_list": "RESPUESTA CON LSITA 2",
"items_list": [
{
"value": "Valor 2",
"synonyms": [],
"idResponse": "CA2_1_E_2",
"title_item": "RESPUESTA 2"
},
{
"value": "Valor 3",
"synonyms": [],
"idResponse": "CA2_1_E_3",
"title_item": "Respuesta 3"
}
],
"title_list": "Titulo en EDICION"
},
"lateral": {},
"finalResponse": {}
}
obj2:
{
"list": {
"text_list": "RESPUESTA Editada",
"items_list": [
{
"value": "Valor 2",
"synonyms": [],
"idResponse": "CA2_1_E_2",
"title_item": "RESPUESTA 2"
},
{
"value": "Valor 3",
"synonyms": [],
"idResponse": "CA2_1_E_3",
"title_item": "Respuesta 5"
}
],
"title_list": "Titulo en EDICION"
},
"lateral": {},
"finalResponse": {}
}