Safely Read & Write in Deeply Nested Objects in Javascript
Gabin Desserprit

I know it’s not always an option, but I think it’s well worth the overhead to just use lodash.

import _ from 'lodash'
const obj = {
some: 'thing'
const prop = _.get(obj, 'some.thing.else')
console.log(prop) // undefined

Works the same way for set.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.