Get By Path
let Obj = {
foo: 2,
bar: "car",
baz: { x: "a", y: "b", biz: { a: { "full name": "Arjunan K" } } },
};
function getByPath(paths, Obj) {
return paths.reduce((prevObj, currKey) => prevObj[currKey], Obj);
}
console.log(getByPath(["baz", "biz", "a", "full name"], Obj));
// Arjunan K