Difference of Typescript Interface declaration

Asked

Viewed 18 times

0

What is the difference between the declaration of the properties of the two interfaces?

interface Modelo {
  propriedade: InterfaceA[]; <= desta forma
}

and in this way:

 interface Modelo {
      propriedade: InterfaceA; <= desta forma
    }
  • 1

    InterfaceA[] indicates that it is an array of InterfaceA: https://www.typescriptlang.org/docs/handbook/basic-types.html#array

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.