interface IPerson {
    name: string;
    age: number;
}
 
function test(opt: IPerson) {
    let key: (keyof IPerson);
    for (key in opt) {
        console.log(opt[key]);
    }
}