I have the following
const key = 'foo';
const test = { foo: { bar: 23 } };
and I would like to use lodash getto access the value test[key].bar.
I want to use the bracket notation for the first indicator ...
_.get(test, '[key].bar'); // results in undefined
Of course there is a way ...
source
share