November 2018
Beginner
502 pages
10h 22m
English
Properties are one of the elements that can be part of an interface. Properties can hold values associated with an object. So, when we define a property in an interface, we are saying that objects that implement the interface must have the property we have defined.
Let's start to play with an interface in the TypeScript playground:
interface Product { name: string; unitPrice: number;}
const table: Product = { name: "Table", unitPrice: 500}
const chair: Product = { ...Read now
Unlock full access