I need to check if a second immutable list is same as that of the original list,so that i can set a boolean value.How can this be done? I tried the following approach
/**
* compare two lists
*/
public comparelists(){
const selectedItems = this.state?.originalgaparameterlist?.filter(item =>
this.gaparameterlist?.some(userItem => userItem.key === item.key)
);
if (selectedItems) {
this.globalParameterChanged = true;
}
else {
this.globalParameterChanged = false;
}
}