_.get alternative code example
Example: _.get alternative
//This Is my alternative to (lodash) _.get() method
const get = (obj, path, def) => (() => typeof path === 'string' ? path.replace(/\[(\d+)]/g,'.$1') : path.join('.'))()
.split('.')
.filter(Boolean)
.every(step => ((obj = obj[step]) !== undefined)) ? obj : def
//Usages Example
var prop = get(data, '[0].items[0].property', 'backupValue');
//returns found value of path