const obj = {
id: 84767,
name: 'Tom',
salary: 13000,
lang: 'TypeScript'
}
function getRandomProperty(obj : any) : any {
const keys = Object.keys(obj);
return keys[Math.floor(Math.random() * keys.length)];
}
console.log(getRandomProperty(obj));
console.log(getRandomProperty(obj));
console.log(getRandomProperty(obj));
/*
run:
"salary"
"id"
"id"
*/