Interfaces and Type Aliases
Video Lecture
Description
In TypeScript, Interfaces and Type aliases offer almost the same functionality, in this video we explore that idea.
An Interface/Type is a structure used for type-checking
An Interface/Type defines the properties and types an object can have.
The difference between an Interface and Type alias is the syntax, and that Type aliases don't support declaration merging. Your IDE intellisence may also show it differently.
Start Script
1 2 3 4 5 6 7 |
|
Final Script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Try it,
tsc foo.ts
node foo.js