object: 除了primitive(boolean null number string undefined bigint symbol)的类型

 

 

Object:

Object和any很像 ,Object有更严格的约束

 

object Object {} any unknown

Object表示装箱后的原始类型对象,即有方法的原始类型(describes funtionality that is common to all JS objects)

和any的区别是:

let a:any

let b:Object

a.nomethod() // okay

b.nomethods() // error

 

{}:

{}和Object一样,根据查询的资料,{}继承了Object但是没有添加任何东西

 

 

unkown:

unknown type is only assignable to the any type and the unknown type itself

object Object {} any unknown

https://mariusschulz.com/blog/the-unknown-type-in-typescript

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2022-01-30
  • 2021-08-20
  • 2021-10-19
  • 2021-12-03
  • 2021-05-14
猜你喜欢
  • 2021-07-19
  • 2021-09-09
  • 2022-12-23
  • 2021-05-14
  • 2021-06-24
  • 2022-12-23
相关资源
相似解决方案