I need to access the "isTouched" property from a nested object. The challenge is that this property could either be shown like this:
form: { CHANGES: { isTouched: true/false } } or
form: { 'formName': { isTouched: true/false } } Accessing the first would straightforward with:
form.CHANGES.isTouched however, I would like to have one method that can cater for both scenarios also considering that the form name will change based on whatever form is being used.
I thought about collecting all of the form names and loop through them but I think that would be not very effective.
form[variable_name].isTouchedcan be used in this case.