I have an object, manageEmpForm that contains many manageEmployee arrays.
I need to compare 2 different instances of this object and ensure every manageEmployee is equal. I'm having trouble wrapping my head around how to construct a loop to achieve the following functionality, without the specific index numbering:
const initialFormValues1 = this.manageEmpForm.controls.manageEmployees.value[0];
const initialFormValues2 = this.manageEmpForm.controls.manageEmployees.value[1];
...
const currentFormValues1 = this.manageEmpForm.controls.manageEmployees.value[0];
const currentFormValues2 = this.manageEmpForm.controls.manageEmployees.value[1];
...
formHasChanged = Object.keys(this.initialFormValues1).some(key => currentFormValues1[key] != this.initialFormValues1[key]) ||
Object.keys(this.initialFormValues2).some(key => currentFormValues2[key] != this.initialFormValues2[key])