Weak types

A weak type is an object literal type in which all properties are optional:

interface User {
name?: string;
age?: number;
}

TypeScript allows us to add a value with some or all the properties defined in the weak type, but it doesn't allow us to assign properties that are not part of the weak type:

let user1: User  = { name: "Remo", age: 28 }; // OK
let user2: User = { firstName: "Remo", yearBorn: 28 }; // Error