xxxxxxxxxx
let nestedObject = { levelOne: { levelTwo: { levelThree : 'final destination'} } }
const prop1 = 'levelOne';
const prop2 = 'levelTwo';
const prop3 = 'levelThree';
var destination = nestedObject[prop1][prop2][prop3];
// destination = 'final destination'
xxxxxxxxxx
var person ={"first_name":"Billy","last_name":"Riley"};
var property_name="first_name";
alert(person[property_name]); //Dynamically access object property with bracket notation