Yes, thisbut not with the syntax you've proposed. This is easiest done when your path is an array of strings:
const tableData = (
{ profile: { firstname: 'jim', lastname: 'johnson' }
}
)
const path = [ 'profile', 'firstname' ]
const valueAtPath = path.reduce((_, x) => _[x], tableData)
console.info(valueAtPath)