If I have a base object which is always the same: project
but sometimes I have to access its fields dynamically, how can I access its fields when it can be 1 or more nested objects for example:
function (myPath){
return project[myPath];
}
This works when using project["oneField"]
in myPath("oneField")
but it does not work when it is nested to or more levels:
myPath("one.two.fieldName")
does not work: project["one.two.fieldName"]
Neither like this: project."one.two.fieldName"