I'm trying to access properties of a JavaScript object by passing a path (string or otherwise):
// In a loop
tableData[i].profile.firstname
where 'profile.firstname' is the path.
Is there a way to access a nested property based on a path in this way?
let firstnamePath = 'profile.firstname'
let firstname = tableData[i][firstnamePath]
_.get(tableData[i], 'profile.firstname')'profile.firstname'.split('.').reduce((_, x) => _[x], tableData)=)