Difference between type[] and [type] in typescript

  • [string] denotes a Tuple of type string
  • string[] denotes an array of strings

The correct usage of the Tuple in your case would be:

let type2:WithStringArray2 = {
    property: ['someString']
};

See Documentation

Leave a Comment