const obj = {
lang1: 'typescript',
lang2: 'c',
lang3: 'c++',
};
const lastKey = Object.keys(obj).pop();
console.log("last key: " + lastKey);
const lastValue = Object.values(obj).pop();
console.log("last value: " + lastValue);
console.log(obj);
/*
run:
"last key: lang3"
"last value: c++"
{
"lang1": "typescript",
"lang2": "c",
"lang3": "c++"
}
*/