July 2017
Intermediate to advanced
384 pages
8h 23m
English
An interface is a way to take a particular structure/shape and give it a name so that we can reference it later as a type. It defines a contract within our code. Interfaces begin with the keyword interface. Let's take an example:
interface Person { name: string children?: number isMarried(): boolean (): void}
The specified interface Person has the following:
Typescript allows you to use the syntax [index: type] to specify a string or number type based collection ...
Read now
Unlock full access