Help pls.
We have object:
let obj = {
hasError: {
income_manager: {
signatory_id: false,
}
},
};
and string:
let halfObject = "income_manager.signatory_id";
how can i splice a string with objects to write a new value?
example:
let variable = halfObject.split('.')
obj.hasError[variable[0]][variable[1]] = true;
But it doesn't look good. Do you have a prettier example?