点击运行
interface Person { [key: string]: any; } const obj: Person = {}; obj.name = 'Tom'; obj.age = 30; console.log(obj);
运行结果 :
正在执行...