July 2018
Intermediate to advanced
420 pages
8h 46m
English
Interfaces are our allies when we use TypeScript, since they do not exist in pure JavaScript. They are an efficient way of grouping and typing variables, ensuring that they are always together, maintaining consistent code.
Let's look at a practical way to declare and use an interface:
interface Band { name: string, total_members: number}To use it, assign the interface to a function type, as in the following example.
interface Band { name: string, total_members: number}function unknowBand(band: Band): void { console.log("This band: " ...Read now
Unlock full access