const o = {
name: 'Lee',
age: 20
};
const createObject = function (obj, key) {
return console.log(obj[key]);
};
createObject(o, 'name');
createObject(o, 'age');
/////
const cobject = function (key, value) {
return { [key]: value}
}
console.log(cobject('name', 'lee'));