typescripttypescript1.7

Differences in Typescript array literal syntax


Typescript allows one to define an Array with either syntax:

var myStrArry1: string[] = [];

or

var myStrArry1: Array<string> = [];

The compiled output appears to be the same. Does the compiler treat them identically, or are there some quirks to be aware of?


Solution

  • Does the compiler treat them identically, or are there some quirks to be aware of?

    They are identical. I prefer syntax 1