Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Object and object type

What is the difference between Object and object in angular typescript

I get a tslint error:

Don't use 'Object' as a type. Avoid using the Object type. Did you mean object?

like image 622
Akhil Ravindran Avatar asked Jan 27 '23 08:01

Akhil Ravindran


1 Answers

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

object represents any non-primitive type. The following types are considered to be primitive types in JavaScript: string, boolean, number, bigint, symbol, null, undefined.

While object (lowercased) represents all non-primitive types, Object (uppercased) describes functionality that is common to all JavaScript objects.

like image 143
Severin Klug Avatar answered Jan 29 '23 14:01

Severin Klug