ScriptOJ-safeGet#99
const safeGet = (data, path) => {
if(!path) return undefined;
const pathArr = path.split('.');
let result = data;
let length = pathArr.length
while(length--) {
const iter = pathArr.shift();
result = result[iter];
if(result === undefined) return undefined;
}
return result
}