What is the difference between Boolean and boolean in Typescript? [duplicate]

Uppercase Boolean is an object type.

Lowercase boolean is a primitive type.

You should always use boolean (the primitive type in your programs).
This is because, the Typescript type system does not force an object to its primitive type, while JavaScript does.

You shouldn’t write:

function yourFunction(foo: Boolean)

But instead always write:

function yourFunction(foo: boolean)

For more info, see TypeScript Lang – Everyday Types

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)