I'm very much in agreement with you, but for different reasons
that lodash _.get methods looks pretty good.. could also have extra functionality to tell you which property was undefined, to help with debugging
and that lodash method COULD be added to the Object.prototype... so you COULD do..
person.lookup('details.name.fullName')
Maybe person is defined but is missing the details object. Maybe there's no fullName property. An actual function call could tell you these things in a very elegant want.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm very much in agreement with you, but for different reasons
that lodash _.get methods looks pretty good.. could also have extra functionality to tell you which property was undefined, to help with debugging
and that lodash method COULD be added to the Object.prototype... so you COULD do..
person.lookup('details.name.fullName')
Maybe person is defined but is missing the details object. Maybe there's no fullName property. An actual function call could tell you these things in a very elegant want.