目录

如何定义一个未知类型的对象

可使用Record类型,有几个属性就对应几个类型参数,参考代码如下:

const asd: Record<string, number | string> = {
  'name': 'xc',
  'age': 29
}