#7 Type Alias (Advanced Types)
When we need a same values of type for different constants, instead of repeating the code, we can simply do as example;
type Employee={name: string, id: number}
let user: Employee={name:"Ram",id:10}
Here, we use *type* to create an object type that can be used for other constants without repeating the code.
Comments
Post a Comment