I have an object
let a = {b : {c : "d"}}
And i have the property who must change with a new value
let prop = "b.c";
let newValue = "e";
So, in my object, the "c" must be edited with the new value.
i tried
a[prop] = newValue; // but it create "b.c" property
let fields = prop.split('.');
a[fields] = newValue; // but it create "b,c" property
// all i want is a dynamic way to do
a[fields[0]][fields[1]] = newValue;
is it possible ?
thanks