TypeScript · Junior · Question 15 of 75
How do you type an array of strings?
- ✓Correct answer:
string[]orArray<string> - 2
[string]orArray[string] - 3
array of stringorstring()
Explanation
string[] and Array<string> are equivalent. [string] is a one-element tuple. For read-only arrays use readonly string[].