BaseCodeByte
Back to TypeScript outline
TSTypeScriptBeginnerEditable example10 min

Interfaces And Types

Interfaces And Types in practical TypeScript programs, with editable notebook code and a focused exercise.

Lesson notes

This lesson turns interfaces and types into a small example you can edit, copy and run locally.

typesinterfacessafer APIs

Editable notebook cell

Starter code

1
2
3
4
5
6
7
8

Output

Editable example
Run the code to see output here.

Try this

Change the sample data, predict the output and note what concept changed.

Hint: Make the smallest possible edit first.