const person = { name : 'Todd' , age : 27 , } ; type Person = typeof person ; type PersonKeys = keyof Person ; type PersonTypes = Person [ PersonKeys ] ; function getProperty < T , K extends keyof T > ( obj , key ) { return obj [ key ] ; } const personName = getProperty ( person , 'age' ) ; const anotherPerson = { name : 'John' , age : 30 , } ;