```ts interface Data { name?: string, // name is optional id: number, nicknames: string[] // A

interface Data {
  name?: string, // name is optional
  id: number,
  nicknames: string[] // Array<string>
}
const Lol: Data = {
  id: 3, // "3" will be invalid because of number type.
  nicknames: ["23","hahaha"]
}
Was this page helpful?