Intermediate TypeScript
Q55 / 100

How does TypeScript handle excess property checks for object literals?

Correct! Well done.

Incorrect.

The correct answer is B) It flags extra properties not defined in the target type when assigning an object literal directly

B

Correct Answer

It flags extra properties not defined in the target type when assigning an object literal directly

Explanation

When an object literal is assigned directly to a typed variable or parameter, TypeScript errors on properties not present in the target type.

Progress
55/100