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 meanobject
?
What is the difference between Object
and object
in angular typescript
I get a tslint error:
Share Improve this question edited May 13, 2019 at 8:01 adiga 35.3k9 gold badges65 silver badges87 bronze badges asked May 13, 2019 at 7:55 Akhil RavindranAkhil Ravindran 1212 silver badges8 bronze badges 2Don't use 'Object' as a type. Avoid using the
Object
type. Did you meanobject
?
- 8 Possible duplicate of difference between object and Object in JavaScript – saurabh Commented May 13, 2019 at 7:58
- @saurabh this is not what OP is asking about – adiga Commented May 13, 2019 at 8:03
1 Answer
Reset to default 8https://mariusschulz./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 mon to all JavaScript objects.