function getPersonalData(key) {
var person = {
age: 21,
name: {
first: 'Bob',
last: 'Smith'
}
};
return person[key];
}
getPersonalData('age'); // 21
getPersonalData('[name][first]');
getPersonalData('name').first
getPersonalData('name')['first']