01 / 06
The other way of declaring a shape
There are in fact two ways to name the shape of an object. One is the type you just did. The other is interface.
You write interface Name { ... }. Using it is exactly the same as with type — you write the name wherever a type goes.
interface Person { name: string; age: number;}const yui: Person = { name: "Yui", age: 20 };console.log(yui);Result
{ name: "Yui", age: 20 }