⊗jstsPmBsOb 7 of 55 menu

Objects in TypeScript

Objects in TypeScript behave in a special way. When declaring objects, the data type is not specified. For example, let's make an object with a user, storing his name and age:

let user = {name: 'john', age: 30};

TypeScript understands that the variable contains an object and controls the structure of this object, protecting it from unforeseen changes. In the following lessons, we will look into working with objects in more detail.

Make an object that contains the year, month and day in the corresponding keys.

enru