对象和对象类型有什么区别

Akh*_*ran 3 javascript typescript angular

angular typescriptObjectobjectangular typescript 有什么区别

我收到一个 tslint 错误:

不要使用“对象”作为类型。避免使用Object类型。你的意思是object

Sev*_*lug 7

https://mariusschulz.com/blog/typescript-2-2-the-object-type

object代表任何非原始类型。以下类型被认为是 JavaScript 中的原始类型:string、boolean、number、bigint、symbol、null、undefined。

虽然object(小写)代表所有非原始类型,但Object (大写)描述所有 JavaScript 对象共有的功能。