December 2017
Beginner
372 pages
10h 32m
English
The primary purpose of an interface is to drive code consistency. An interface is a contract defined and any class that implements the interface needs to implement all the properties of that interface. The interface is a pure TypeScript concept and is not part of ECMAScript; this means that when TypeScript code is converted to JavaScript, interfaces are not converted:
interface Planet{ name: string; weather: string; }class Earth implements Planet { name: string; weather: string;}let planet: Planet= new Earth();
Read now
Unlock full access