let myJson={
"name1": {
"name2": {
"name3": {
"value": 5
}
}
}
}
And I have this string:
let string="name1.name2.name3";
How to access to myJson
using this string? the result should be:
{ value:5 }
The right way is:
console.log(myJson.name1.name2.name3);
but I have a different scenario in which I must do so in the previous way (using the string).