I Have the following json variable:
var test = {
A: {
A1: 1,
A2: "Something",
A3: 't'
},
B: "Something else",
C: {
C1: true
}
}
now I have a variable "path" with a path to the value I want to change. Examples:
path = "A.A1",
path = "A.A3",
path = "B",
path = "C.C1".
From these values, I can split it into an array or whatever, but what I need afterwards is to access (and modify) the variable "test" from the path I got. Is there some generic way of doing that? Or my best alternative is to create a recursive function using the splitted array?